add a new log level (trace)
This commit is contained in:
parent
711b60d454
commit
47d7722f6e
5 changed files with 28 additions and 2 deletions
18
src/log.cpp
18
src/log.cpp
|
|
@ -17,10 +17,28 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
// TODO: improve these routines to allow logging to memory for eventual log window!
|
||||
|
||||
#include "ta-log.h"
|
||||
|
||||
int logLevel=LOGLEVEL_INFO;
|
||||
|
||||
int logV(const char* format, ...) {
|
||||
va_list va;
|
||||
int ret;
|
||||
if (logLevel<LOGLEVEL_TRACE) return 0;
|
||||
#ifdef _WIN32
|
||||
printf("[trace] ");
|
||||
#else
|
||||
printf("\x1b[1;37m[trace]\x1b[m ");
|
||||
#endif
|
||||
va_start(va,format);
|
||||
ret=vprintf(format,va);
|
||||
va_end(va);
|
||||
fflush(stdout);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int logD(const char* format, ...) {
|
||||
va_list va;
|
||||
int ret;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue