Skip to content

TaurusEight/stone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Time-stamp: <2015-12-20 18:30:45 daniel>

--STONE--

A simple thread safe logging class.

The class is defined in a single header file and a single source file.

             'stone.hh' and 'stone.cc'


Use
---
To log to a file use '#define __LOG_TO_FILE__' then include 'stone.hh'.
To log to std::cerr use '#define __LOG_TO_CERR__ then include 'stone.hh.
Default file is 'log.out' this can be changed using 'LOGFILE( filename );'
Logging is then done with either INFO, WARN or ERROR:

        INFO( "value of x in hex is " << std::hex << x << std::endl );
        WARN( message << std::endl );
        ERROR( "software bug" << __line__ << ":" << __file__ << std::endl );


Limitations
-----------
Curently switching files can result loss of information if you
change back to the original file by using 'LOGFILE( filename );'
several times.


Improvements
------------
A nice feature would be to allow several files for logging rather than one.

About

A simple thread safe logging class

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published