axom icon indicating copy to clipboard operation
axom copied to clipboard

Add convenience methods for adding common streams to slic

Open gzagaris opened this issue 5 years ago • 0 comments

Currently, to log to a file, the application has to write code that looks like this:

std::ofstream file;
file.open( "log.dat" );
slic::addStreamToAllMsgLevels( new slic::GenericOutputStream(&file) );

...

file.close();

This can be simplified by something like the following

slic::addFileStream( "log.dat", bitmask );

The second argument is a bitmask that indicates the log message levels that the stream will be bound to (similar to the way the createLogger() function works.

Similarly, for steams that output information to the screen, e.g., std::cout and std::cerr.

This would also make these functions easier to be wrapped and called from Fortran.

gzagaris avatar May 13 '19 16:05 gzagaris