-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
54 lines (43 loc) · 1.47 KB
/
main.cpp
File metadata and controls
54 lines (43 loc) · 1.47 KB
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
45
46
47
48
49
50
51
52
53
54
/* -8- ***********************************************************************
*
* main.cpp
*
* Created by ogata on 11/26/2013
* Copyright (c) 2013 ABEJA Inc. All rights reserved.
* ******************************************************************** -8- */
#include "logger.hpp"
void test_logging()
{
boost::log::sources::severity_logger< logger::severity_level > slg;
BOOST_LOG_FUNCTION();
BOOST_LOG_SEV(slg, logger::ERROR) << "test";
}
void test_logging2()
{
boost::log::sources::severity_logger< logger::severity_level > slg;
BOOST_LOG_SEV(slg, logger::ERROR) << "test2";
}
void test_setLoggingLevel()
{
BOOST_LOG_FUNCTION();
std::cout << "---- start test_setLoggingLevel ----" << std::endl;
BOOST_LOG_SEV(app_logger::get(), logger::DEBUG) << "first debug";
BOOST_LOG_SEV(app_logger::get(), logger::TRACE) << "first trace";
std::cout << "set filter level \"DEBUG\"" << std::endl;
logger::setLoggingLevel(logger::DEBUG);
BOOST_LOG_SEV(app_logger::get(), logger::DEBUG) << "second debug"; // printed
BOOST_LOG_SEV(app_logger::get(), logger::TRACE) << "second trace"; // filtered
std::cout << "---- end test_setLoggingLevel ----" << std::endl;
}
int main(int argc, char *argv[])
{
// initalize
logger::initLogging();
// set __LINE__ and __FUNCTION__
BOOST_LOG_FUNCTION();
test_logging();
test_logging2();
test_setLoggingLevel();
std::cout << "---- end ----" << std::endl;
return 0;
}