]> git.mxchange.org Git - simgear.git/blob - simgear/debug/logtest.cxx
Merge branch 'next' of git.mxchange.org:/var/cache/git/repos/simgear into next
[simgear.git] / simgear / debug / logtest.cxx
1 #include <string>
2 #include <simgear/debug/logstream.hxx>
3
4 class Test {
5
6         public:
7         Test() {
8           //cout << "Cout seems to work" << endl;
9           //cerr << "Cerr seems to work" << endl;
10           
11           sglog().setLogLevels( SG_ALL, SG_INFO );
12           
13           SG_LOG(SG_EVENT, SG_INFO, "Test::Test" << "foo");
14         }
15
16 };
17
18 Test test;
19
20 int
21 main( int argc, char* argv[] )
22 {
23     sglog().setLogLevels( SG_ALL, SG_INFO );
24
25     //SG_LOG( FG_TERRAIN, FG_BULK,  "terrain::bulk" ); // shouldnt appear
26     //SG_LOG( FG_TERRAIN, SG_DEBUG, "terrain::debug" ); // shouldnt appear
27     //SG_LOG( FG_TERRAIN, SG_INFO,  "terrain::info" );
28     //SG_LOG( FG_TERRAIN, FG_WARN,  "terrain::warn" );
29     //SG_LOG( FG_TERRAIN, SG_ALERT, "terrain::alert" );
30
31     int i = 12345;
32     long l = 54321L;
33     double d = 3.14159;
34     string s = "Hello world!";
35
36     SG_LOG( SG_EVENT, SG_INFO, "event::info "
37                                  << "i=" << i
38                                  << ", l=" << l
39                                  << ", d=" << d
40                                  << ", d*l=" << d*l
41                                  << ", s=\"" << s << "\"" );
42
43     // This shouldn't appear in log output:
44     SG_LOG( SG_EVENT, SG_DEBUG, "event::debug "
45             << "- this should be seen - "
46             << "d=" << d
47             << ", s=\"" << s << "\"" );
48
49     return 0;
50 }