1 |
/*************************************************************************** |
/*************************************************************************** |
2 |
* * |
* * |
3 |
* Copyright (C) 2008 - 2012 Andreas Persson * |
* Copyright (C) 2008 - 2013 Andreas Persson * |
4 |
* * |
* * |
5 |
* This program is free software; you can redistribute it and/or modify * |
* This program is free software; you can redistribute it and/or modify * |
6 |
* it under the terms of the GNU General Public License as published by * |
* it under the terms of the GNU General Public License as published by * |
58 |
LinuxSampler::Mutex logmutex; |
LinuxSampler::Mutex logmutex; |
59 |
|
|
60 |
void log(const char* fmt, ...) { |
void log(const char* fmt, ...) { |
61 |
logmutex.Lock(); |
LockGuard lock(logmutex); |
62 |
FILE* f = fopen((String(getenv("TEMP")) + "\\linuxsamplervst.log").c_str(), "a"); |
FILE* f = fopen((String(getenv("TEMP")) + "\\linuxsamplervst.log").c_str(), "a"); |
63 |
va_list ap; |
va_list ap; |
64 |
va_start(ap, fmt); |
va_start(ap, fmt); |
65 |
vfprintf(f, fmt, ap); |
vfprintf(f, fmt, ap); |
66 |
va_end(ap); |
va_end(ap); |
67 |
fclose(f); |
fclose(f); |
|
logmutex.Unlock(); |
|
68 |
} |
} |
69 |
#undef dmsg |
#undef dmsg |
70 |
#define dmsg(debuglevel,x) log x; |
#define dmsg(debuglevel,x) log x; |