ReFRACtor
FullPhysics::LogImp Class Referenceabstract

The actual implementation of the Logger. More...

#include <logger.h>

+ Inheritance diagram for FullPhysics::LogImp:
+ Collaboration diagram for FullPhysics::LogImp:

Public Types

enum  log_level {
  DEBUG = 4, INFO =3, WARNING =2, ERROR =1,
  FATAL =0
}
 

Public Member Functions

virtual ~LogImp ()
 
virtual void flush (log_level l)=0
 Flush data to the log, at the given level. More...
 
void print (std::ostream &Os)
 
std::string print_to_string () const
 Print to string. More...
 
virtual std::ostream * stream ()=0
 Underlying stream, can be null if no underlying stream. More...
 
template<class T >
void write (log_level l, const T &v)
 
void write (log_level l, const std::string &v)
 Write to a log. More...
 
void write (log_level l, const char *v)
 

Protected Attributes

std::ostringstream os
 

Detailed Description

The actual implementation of the Logger.

Definition at line 11 of file logger.h.

Member Enumeration Documentation

◆ log_level

Enumerator
DEBUG 
INFO 
WARNING 
ERROR 
FATAL 

Definition at line 14 of file logger.h.

Constructor & Destructor Documentation

◆ ~LogImp()

virtual FullPhysics::LogImp::~LogImp ( )
inlinevirtual

Definition at line 13 of file logger.h.

Member Function Documentation

◆ flush()

virtual void FullPhysics::LogImp::flush ( log_level  l)
pure virtual

Flush data to the log, at the given level.

Implemented in FullPhysics::FpLogger.

◆ print()

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

Definition at line 33 of file logger.h.

◆ print_to_string()

std::string FullPhysics::Printable< LogImp >::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.

◆ stream()

virtual std::ostream* FullPhysics::LogImp::stream ( )
pure virtual

Underlying stream, can be null if no underlying stream.

Implemented in FullPhysics::FpLogger.

◆ write() [1/3]

template<class T >
void FullPhysics::LogImp::write ( log_level  l,
const T &  v 
)
inline

Definition at line 15 of file logger.h.

◆ write() [2/3]

void LogImp::write ( log_level  l,
const std::string &  v 
)

Write to a log.

Definition at line 45 of file logger.cc.

◆ write() [3/3]

void FullPhysics::LogImp::write ( log_level  l,
const char *  v 
)
inline

Definition at line 18 of file logger.h.

Member Data Documentation

◆ os

std::ostringstream FullPhysics::LogImp::os
protected

Definition at line 35 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