1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
#include "../log4z.h"
#include <iostream>
#include <stdio.h>
using namespace zsummer::log4z;
int main(int argc, char *argv[])
{
//start log4z
ILog4zManager::GetInstance()->Start();
//LOGD: LOG WITH level LOG_DEBUG
//LOGI: LOG WITH level LOG_INFO
//...
LOGD(" *** " << "hellow wolrd" <<" *** ");
LOGI("loginfo");
LOGW("log warning");
LOGE("log err");
LOGA("log alarm");
LOGF("log fatal");
LOGD("char:" <<'c'
<< ", unsigned char:" << (unsigned char) 'c'
<< ", short:" << (short) -1
<< ", unsigned short:" << (unsigned short) -1
<< ", int:" << (int) -1
<< ", unsigned int:" << (unsigned int) -1
<< ", long:" << (long) -1
<< ", unsigned long:" << (unsigned long) -1
<< ", long long:" << (long long) -1
<< ", unsigned long long:" << (unsigned long long) -1
<< ", float:" << (float) -1.234567
<< ", double:" << (double) -2.34566
<< ", std::string:" << std::string("fffff")
<< ", void *:" << ( int *) argv
<< ", const void*:" << (const int *) argv
<< ", constant:" << 1000
<< ", constant:" << 100.12345678
<< ", bool:" << (bool) true);
LOGA("press anykey to exit ...");
getchar();
return 0;
}
|