UtiLite
0.3.1
A lite utilities library
|
ULogger class and convenient macros. More...
#include "utilite/UtiLiteExp.h"
#include "utilite/UMutex.h"
#include "utilite/UDestroyer.h"
#include "utilite/UEvent.h"
#include <stdio.h>
#include <time.h>
#include <string>
#include <vector>
#include <stdarg.h>
Go to the source code of this file.
Classes | |
class | ULogEvent |
class | ULogger |
Defines | |
#define | UDEBUG(...) ULOGGER_DEBUG(__VA_ARGS__) |
#define | UINFO(...) ULOGGER_INFO(__VA_ARGS__) |
#define | UWARN(...) ULOGGER_WARN(__VA_ARGS__) |
#define | UERROR(...) ULOGGER_ERROR(__VA_ARGS__) |
#define | UFATAL(...) ULOGGER_FATAL(__VA_ARGS__) |
#define | UASSERT(condition) if(!(condition)) ULogger::write(ULogger::kFatal, __FILE__, __LINE__, __FUNCTION__, "Condition (%s) not met!", #condition) |
ULogger class and convenient macros.
This contains macros useful for logging a message anywhere in the application. Once the ULogger is set, use these macros like a printf to print debug messages.
#define UASSERT | ( | condition | ) | if(!(condition)) ULogger::write(ULogger::kFatal, __FILE__, __LINE__, __FUNCTION__, "Condition (%s) not met!", #condition) |
Print a fatal error level message in the logger if condition is not met. The application will exit on fatal error. Format is the same as a printf:
UASSERT(a!=42, "This is a fatal error message with the number %d", 42);
#define UDEBUG | ( | ... | ) | ULOGGER_DEBUG(__VA_ARGS__) |
Print a debug level message in the logger. Format is the same as a printf:
UDEBUG("This is a debug message with the number %d", 42);
#define UERROR | ( | ... | ) | ULOGGER_ERROR(__VA_ARGS__) |
Print an error level message in the logger. Format is the same as a printf:
UERROR("This is an error message with the number %d", 42);
#define UFATAL | ( | ... | ) | ULOGGER_FATAL(__VA_ARGS__) |
Print a fatal error level message in the logger. The application will exit on fatal error. Format is the same as a printf:
UFATAL("This is a fatal error message with the number %d", 42);
#define UINFO | ( | ... | ) | ULOGGER_INFO(__VA_ARGS__) |
Print a information level message in the logger. Format is the same as a printf:
UINFO("This is a information message with the number %d", 42);