ReFRACtor
FullPhysics::Logger Class Reference

This is a simple logger. More...

#include <logger.h>

+ Inheritance diagram for FullPhysics::Logger:
+ Collaboration diagram for FullPhysics::Logger:

Public Member Functions

void print (std::ostream &Os)
 
std::string print_to_string () const
 Print to string. More...
 

Static Public Member Functions

static LogHelper debug ()
 
static LogHelper error ()
 
static LogHelper fatal ()
 
static LogHelper info ()
 
static Loggerinstance ()
 The logger instance. More...
 
static LogHelper log (LogImp::log_level l)
 
static void set_implementation (const boost::shared_ptr< LogImp > &imp)
 Set the implementation. More...
 
static void set_implementation (LogImp *imp)
 Set the implementation. More...
 
static std::ostream * stream ()
 Underlying stream, can be null if no underlying stream. More...
 
static LogHelper warning ()
 

Detailed Description

This is a simple logger.

The logger depends on a specific implementation being set by set_implementation. If we don't have an implementation set, then the logger doesn't do anything.

The logger is a singleton, there is just one global logger. You can directly access it through instance, but normally you just do things like "Logger::debug() << 'My debug message\n'". Data is flushed when a "\n" is encountered, you should end all messages with "\n".

Definition at line 69 of file logger.h.

Member Function Documentation

◆ debug()

static LogHelper FullPhysics::Logger::debug ( )
inlinestatic

Definition at line 108 of file logger.h.

◆ error()

static LogHelper FullPhysics::Logger::error ( )
inlinestatic

Definition at line 111 of file logger.h.

◆ fatal()

static LogHelper FullPhysics::Logger::fatal ( )
inlinestatic

Definition at line 112 of file logger.h.

◆ info()

static LogHelper FullPhysics::Logger::info ( )
inlinestatic

Definition at line 109 of file logger.h.

◆ instance()

Logger & Logger::instance ( )
static

The logger instance.

Return the instance of the Logger.

Definition at line 35 of file logger.cc.

◆ log()

static LogHelper FullPhysics::Logger::log ( LogImp::log_level  l)
inlinestatic

Definition at line 106 of file logger.h.

◆ print()

void FullPhysics::Logger::print ( std::ostream &  Os)
inline

Definition at line 113 of file logger.h.

◆ print_to_string()

std::string FullPhysics::Printable< Logger >::print_to_string ( ) const
inlineinherited

Print to string.

This is primarily useful for SWIG wrappers to this class, e.g. a to_s method in ruby.

Definition at line 31 of file printable.h.

◆ set_implementation() [1/2]

static void FullPhysics::Logger::set_implementation ( const boost::shared_ptr< LogImp > &  imp)
inlinestatic

Set the implementation.

It is perfectly legal for this to be a null pointer, in that case we just don't send log messages anywhere.

Definition at line 77 of file logger.h.

◆ set_implementation() [2/2]

static void FullPhysics::Logger::set_implementation ( LogImp imp)
inlinestatic

Set the implementation.

It is perfectly legal for this to be a null pointer, in that case we just don't send log messages anywhere.

Definition at line 86 of file logger.h.

◆ stream()

static std::ostream* FullPhysics::Logger::stream ( )
inlinestatic

Underlying stream, can be null if no underlying stream.

Definition at line 93 of file logger.h.

◆ warning()

static LogHelper FullPhysics::Logger::warning ( )
inlinestatic

Definition at line 110 of file logger.h.


The documentation for this class was generated from the following files:

Copyright © 2017, California Institute of Technology.
ALL RIGHTS RESERVED.
U.S. Government Sponsorship acknowledged.
Generated Fri Aug 24 2018 15:44:13