@@ -43,38 +43,34 @@ int main(int argc, char *argv[])
4343{
4444 QCoreApplication mainApp(argc, argv);
4545
46- // Add these lines at the beginning of your program.
47- // The devices and formatters are automatically deleted by SLogLib.
4846 using namespace SLogLib;
4947
50- addLoggingDevice( new ConsoleLogger(new NullFormatter) );
48+ addLoggingDevice( new ConsoleLogger(new NullFormatter) );
5149 addLoggingDevice( new FileLogger("foo.log", new DetailedFormatter) );
5250
5351 // The following line writes the message to both console and file.
52+ // Console means standard output, and output file means 'foo.log'.
5453 int a = 10;
5554 double b = 15.3;
5655 const char* c = "Success";
5756 SLOGLIB_LOG_MSG_INFO("a = " << a << " b = " << b);
5857 SLOGLIB_LOG_MSG_INFO(c);
5958
6059 return 0;
61- // return a.exec();
6260}
6361```
6462
6563### Example for udp transmission
6664```cpp
6765int main()
6866{
69- // Add these lines at the beginning of your program.
70- // The devices and formatters are automatically deleted by SLogLib.
7167 using namespace SLogLib;
7268
73- std::string strDestAddress = "192.168.137.1";
74- unsigned short destPort = 5000;
69+ std::string strDestAddress = "192.168.137.1";
70+ unsigned short destPort = 5000;
7571 addLoggingDevice(new UdpLogger(strDestAddress, destPort, new NullFormatter));
7672
77- // The following line writes the message to both console and file .
73+ // The following line writes the message to UDP socket .
7874 int a = 10;
7975 double b = 15.3;
8076 const char* c = "Success";
0 commit comments