blob: 58dca588ac6e9c161e2761563860d0237fa3ed92 (
plain)
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
43
44
|
// Copyright 2008 Nanorex, Inc. See LICENSE file for details.
#include "NXLoggerTest.h"
CPPUNIT_TEST_SUITE_REGISTRATION(NXLoggerTest);
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(NXLoggerTest, "NXLoggerTestSuite");
/* FUNCTION: setUp */
void NXLoggerTest::setUp() {
}
/* FUNCTION: tearDown */
void NXLoggerTest::tearDown() {
}
/* FUNCTION: consoleHandlerTest */
void NXLoggerTest::consoleHandlerTest() {
printf("\n");
NXLogger* logger = new NXLogger();
logger->addHandler(new NXConsoleLogHandler(NXLogLevel_Info));
logger->log(NXLogLevel_Info, "src", "msg");
NXLOG_DEBUG("foo", "bar");
NXLOG_CONFIG("cpu", "fast");
NXLOG_INFO("app", "started");
NXLOG_WARNING("app", "in trouble");
NXLOG_SEVERE("app", "exiting");
delete logger;
CPPUNIT_ASSERT(true);
}
/* FUNCTION: fileHandlerTest */
void NXLoggerTest::fileHandlerTest() {
printf("\n");
NXLogger* logger = new NXLogger();
logger->addHandler(new NXFileLogHandler("NXLoggerTest.log",
NXLogLevel_Info));
logger->log(NXLogLevel_Info, "src", "msg");
delete logger;
CPPUNIT_ASSERT(true);
}
|