logtest.cxx

00001 #include <string>
00002 #include "Debug/logstream.hxx"
00003 
00004 class Test {
00005 
00006         public:
00007         Test() {
00008           //cout << "Cout seems to work" << endl;
00009           //cerr << "Cerr seems to work" << endl;
00010           
00011           sglog().setLogLevels( SG_ALL, SG_INFO );
00012           
00013           SG_LOG(SG_EVENT, SG_INFO, "Test::Test" << "foo");
00014         }
00015 
00016 };
00017 
00018 Test test;
00019 
00020 int
00021 main( int argc, char* argv[] )
00022 {
00023     sglog().setLogLevels( SG_ALL, SG_INFO );
00024 
00025     //SG_LOG( FG_TERRAIN, FG_BULK,  "terrain::bulk" ); // shouldnt appear
00026     //SG_LOG( FG_TERRAIN, SG_DEBUG, "terrain::debug" ); // shouldnt appear
00027     //SG_LOG( FG_TERRAIN, SG_INFO,  "terrain::info" );
00028     //SG_LOG( FG_TERRAIN, FG_WARN,  "terrain::warn" );
00029     //SG_LOG( FG_TERRAIN, SG_ALERT, "terrain::alert" );
00030 
00031     int i = 12345;
00032     long l = 54321L;
00033     double d = 3.14159;
00034     string s = "Hello world!";
00035 
00036     SG_LOG( SG_EVENT, SG_INFO, "event::info "
00037                                  << "i=" << i
00038                                  << ", l=" << l
00039                                  << ", d=" << d
00040                                  << ", d*l=" << d*l
00041                                  << ", s=\"" << s << "\"" );
00042 
00043     // This shouldn't appear in log output:
00044     SG_LOG( SG_EVENT, SG_DEBUG, "event::debug "
00045             << "- this should be seen - "
00046             << "d=" << d
00047             << ", s=\"" << s << "\"" );
00048 
00049     return 0;
00050 }

Generated on Mon Dec 17 09:30:54 2007 for SimGear by  doxygen 1.5.1