File indexing completed on 2026-04-09 07:49:14
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #include <plog/Log.h>
0023 #include <plog/Init.h>
0024
0025 #include <plog/Formatters/MessageOnlyFormatter.h>
0026 #include <plog/Formatters/FuncMessageFormatter.h>
0027 #include <plog/Formatters/TxtFormatter.h>
0028 #include <plog/Formatters/CsvFormatter.h>
0029
0030 #include <plog/Appenders/ColorConsoleAppender.h>
0031
0032
0033
0034
0035 #define fatal plog::fatal
0036 #define error plog::error
0037 #define warning plog::warning
0038 #define info plog::info
0039 #define debug plog::debug
0040 #define trace plog::verbose
0041
0042 using namespace plog ;
0043
0044
0045
0046
0047 int main(int, char** argv)
0048 {
0049
0050 typedef plog::FuncMessageFormatter FMT ;
0051
0052
0053
0054 static plog::ColorConsoleAppender<FMT> consoleAppender;
0055 plog::init(plog::verbose, &consoleAppender);
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068 LOG(fatal) << argv[0] ;
0069 LOG(error) << argv[0] ;
0070 LOG(warning) << argv[0] ;
0071 LOG(info) << argv[0] ;
0072 LOG(debug) << argv[0] ;
0073 LOG(trace) << argv[0] ;
0074
0075
0076
0077 LOG_IF(info, 1 ) << argv[0] << " this does same as above line and avoids dangling else warning " ;
0078
0079
0080 int ilevel = info ;
0081 plog::Severity level = info ;
0082
0083 LOG(level) << "gello " ;
0084 LOG((plog::Severity)ilevel) << "i-gello " ;
0085
0086 std::cout << " (int)fatal " << (int)fatal << std::endl ;
0087 std::cout << " (int)error " << (int)error << std::endl ;
0088 std::cout << " (int)warning " << (int)warning << std::endl ;
0089 std::cout << " (int)info " << (int)info << std::endl ;
0090 std::cout << " (int)debug " << (int)debug << std::endl ;
0091 std::cout << " (int)verbose " << (int)verbose << std::endl ;
0092
0093
0094
0095
0096 return 0 ;
0097 }
0098
0099
0100