Skip to content

SC0x77/Logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A thread safe, simple and flexible C++ logging library (based on templates)

Usage Example

	// set logging level (as default DEBUG3)
	Log::ReportingLevel() = Log::LevelFromString( "WARNING" );
	
	// initialize a log file
	LOG_FILE_INIT( "MyLog.log" );
	
	LOG_IS_OUTPUT_TIME( true );
	
	// writes message in the log file
	LOG_INFO << "Initialize the log file!";

	LOG_IS_OUTPUT_TIME( false );
	
	// int _l[] = { 4, 8, 15, 16, 23, 42 };
	LOG_DEBUG << "LOST numbers: "<<_l[0]<<_l[1]<<_l[2]<<_l[3]<<_l[4]<<_l[5]<<" end.\n";
	
	// after this, all next messages will be output to the console
	LOG_USE_STDERR;
	
	LOG_INFO << "end of the world in 10 minutes...\n" << "please press a button";
	
	// again writes message in the log file ...
	LOG_USE_FILE;
	
	LOG_ERROR << "now the end of the world\n";

License

Public domain.

About

A thread safe, simple and very flexible C++ logger library (based on templates)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published