#include <sstream>
#include <string>
#include <stdio.h>
#include <iostream>
#include <sys/time.h>
Go to the source code of this file.
Classes | |
class | Log< T > |
class | Output2FILE |
class | FILELog |
Defines | |
#define | ERROR "ERROR" |
#define | WARNING "WARNING" |
#define | INFO "INFO" |
#define | DEBUG "DEBUG" |
#define | DEBUG1 "DEBUG1" |
#define | FILELOG_DECLSPEC |
#define | FILELOG_MAX_LEVEL logDEBUG |
#define | FILE_LOG(level) |
Enumerations | |
enum | TLogLevel { logERROR, logWARNING, logINFO, logDEBUG1, logDEBUG } |
Functions | |
std::string | NowTime () |
#define ERROR "ERROR" |
#define WARNING "WARNING" |
#define INFO "INFO" |
#define DEBUG "DEBUG" |
#define DEBUG1 "DEBUG1" |
#define FILE_LOG | ( | level | ) |
Value:
if (level > FILELOG_MAX_LEVEL) ;\ else if (level > FILELog::ReportingLevel() || !Output2FILE::Stream()) ; \ else FILELog().Get(level)
Definition at line 133 of file Log.hh.
Referenced by main().
enum TLogLevel |
std::string NowTime | ( | ) | [inline] |
Definition at line 140 of file Log.hh.
00141 { 00142 char buffer[11]; 00143 time_t t; 00144 time(&t); 00145 tm r = {0}; 00146 strftime(buffer, sizeof(buffer), "%X", localtime_r(&t, &r)); 00147 struct timeval tv; 00148 gettimeofday(&tv, 0); 00149 char result[100] = {0}; 00150 std::sprintf(result, "%s.%03ld", buffer, (long)tv.tv_usec / 1000); 00151 return result; 00152 }