Gazebo Common

API Reference

3.17.1

Terminal logger. More...

#include <Console.hh>

Classes

class  Buffer
 String buffer for the base logger. More...
 

Public Types

enum  LogType { STDOUT, STDERR }
 Output destination type. More...
 

Public Member Functions

 Logger (const std::string &_prefix, const int _color, const LogType _type, const int _verbosity)
 Constructor. More...
 
virtual ~Logger ()
 Destructor. More...
 
virtual Logger & operator() ()
 Access operator. More...
 
virtual Logger & operator() (const std::string &_file, int _line)
 Output a filename and line number, then return a reference to the logger. More...
 
- Public Member Functions inherited from ostream
T ostream (T... args)
 
T ~ostream (T... args)
 
T bad (T... args)
 
T clear (T... args)
 
T copyfmt (T... args)
 
T eof (T... args)
 
T exceptions (T... args)
 
T fail (T... args)
 
T fill (T... args)
 
T flags (T... args)
 
T flush (T... args)
 
T getloc (T... args)
 
T good (T... args)
 
T imbue (T... args)
 
T init (T... args)
 
T iword (T... args)
 
T move (T... args)
 
T narrow (T... args)
 
T operator bool (T... args)
 
T operator! (T... args)
 
T operator<< (T... args)
 
T precision (T... args)
 
T put (T... args)
 
T pword (T... args)
 
T rdbuf (T... args)
 
T rdstate (T... args)
 
T register_callback (T... args)
 
T seekp (T... args)
 
T set_rdbuf (T... args)
 
T setf (T... args)
 
T setstate (T... args)
 
T swap (T... args)
 
T sync_with_stdio (T... args)
 
T tellp (T... args)
 
T tie (T... args)
 
T unsetf (T... args)
 
T widen (T... args)
 
T width (T... args)
 
T write (T... args)
 
T xalloc (T... args)
 

Detailed Description

Terminal logger.

Member Enumeration Documentation

◆ LogType

enum LogType

Output destination type.

Enumerator
STDOUT 

Output to stdout.

STDERR 

Output to stderr.

Constructor & Destructor Documentation

◆ Logger()

Logger ( const std::string &  _prefix,
const int  _color,
const LogType  _type,
const int  _verbosity 
)

Constructor.

Parameters
[in]_prefixString to use as prefix when logging to file.
[in]_colorColor of the output stream.
[in]_typeOutput destination type (STDOUT, or STDERR)
[in]_verbosityVerbosity level.

◆ ~Logger()

virtual ~Logger ( )
virtual

Destructor.

Member Function Documentation

◆ operator()() [1/2]

virtual Logger& operator() ( )
virtual

Access operator.

Returns
Reference to this logger.

◆ operator()() [2/2]

virtual Logger& operator() ( const std::string &  _file,
int  _line 
)
virtual

Output a filename and line number, then return a reference to the logger.

Parameters
[in]_fileFilename to output.
[in]_lineLine number in the _file.
Returns
Reference to this logger.

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