Class Logger
Defined in File Logger.hpp
Class Documentation
-
class Logger
Manages and logs outputs from GridKit code.
All methods and data in this class are static.
Public Types
Public Static Functions
-
static std::ostream &error()
Returns reference to output stream for error messages.
- Returns:
Reference to error messages stream in
output_streams_.- Pre:
output_streams_vector is allocated and correctly initialized.
-
static std::ostream &warning()
Returns reference to output stream for warning messages.
- Returns:
Reference to warning messages stream in
output_streams_.- Pre:
output_streams_vector is allocated and correctly initialized.
-
static std::ostream &summary()
Returns reference to analysis summary messages output stream.
- Returns:
Reference to analysis summary messages stream in
output_streams_.- Pre:
output_streams_vector is allocated and correctly initialized.
-
static std::ostream &misc()
Returns reference to output stream for all other messages.
- Returns:
Reference to output stream to miscellaneous messages in
output_streams_.- Pre:
output_streams_vector is allocated and correctly initialized.
-
static void setOutput(std::ostream &out)
Set outputs of active streams to user provided
std::ostreamobject.All active outputs are redirected to
outstream. All inactive ones are directed to null device.- Parameters:
out – [in] - User provided output stream.
- Pre:
output_streams_vector is allocated and correctly initialized.- Post:
All active streams (
output_streams_[i]wherei <= verbosity_) are set to user providedoutoutput stream.
-
static void openOutputFile(std::string filename)
Open file
filenameand update outputs for different verbosities streams.- Parameters:
filename – [in] - The name of the output file.
- Pre:
output_streams_vector is allocated and correctly initialized.- Post:
All active streams are directed to user supplied file
filename.
-
static void closeOutputFile()
Close output file.
- Pre:
Output file
file_has been opened.- Post:
Output file
file_is closed and active output streams are set to default outputstd::cout.
-
static void setVerbosity(Verbosity v)
Sets verbosity level.
- Pre:
output_streams_vector is allocated- Post:
Verbosity level is set to user supplied value
vand outputs foroutput_streams_are set accordingly.
-
static std::vector<std::ostream*> &init()
Delivers default values for output streams.
-
static std::ostream &error()