Gazebo Common

API Reference

5.6.0
FileLogger Class Reference

A logger that outputs messages to a file. More...

#include <Console.hh>

Classes

class  Buffer
 String buffer for the file logger. More...
 
◆ operator()() [2/2]

Public Member Functions

 FileLogger (const std::string &_filename="")
 Constructor. More...
 
virtual ~FileLogger ()
 Destructor. More...
 
void Close ()
 Close the open file handles. More...
 
void Init (const std::string &_directory, const std::string &_filename)
 Initialize the file logger. More...
 
std::string LogDirectory () const
 Get the full path of the directory where all the log files are stored. More...
 
virtual FileLoggeroperator() ()
 Output a filename and line number, then return a reference to the logger. More...
 
virtual FileLoggeroperator() (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
ostream (T... args)
 
~ostream (T... args)
 
bad (T... args)
 
clear (T... args)
 
copyfmt (T... args)
 
eof (T... args)
 
exceptions (T... args)
 
fail (T... args)
 
fill (T... args)
 
flags (T... args)
 
flush (T... args)
 
getloc (T... args)
 
good (T... args)
 
imbue (T... args)
 
init (T... args)
 
iword (T... args)
 
move (T... args)
 
narrow (T... args)
 
operator bool (T... args)
 
operator! (T... args)
 
operator<< (T... args)
 
precision (T... args)
 
put (T... args)
 
pword (T... args)
 
rdbuf (T... args)
 
rdstate (T... args)
 
register_callback (T... args)
 
seekp (T... args)
 
set_rdbuf (T... args)
 
setf (T... args)
 
setstate (T... args)
 
swap (T... args)
 
sync_with_stdio (T... args)
 
tellp (T... args)
 
tie (T... args)
 
unsetf (T... args)
 
widen (T... args)
 
width (T... args)
 
write (T... args)
 
xalloc (T... args)
 
- Public Member Functions inherited from basic_ostream< char >
basic_ostream (T... args)
 
~basic_ostream (T... args)
 
bad (T... args)
 
clear (T... args)
 
copyfmt (T... args)
 
eof (T... args)
 
exceptions (T... args)
 
fail (T... args)
 
fill (T... args)
 
flags (T... args)
 
flush (T... args)
 
getloc (T... args)
 
good (T... args)
 
imbue (T... args)
 
init (T... args)
virtual FileLogger& 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: gs)   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)   - Public Member Functions inherited from basic_ios< char >basic_ios (T... args)   T ~basic_ios (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 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 precision (T... args)   T pword (T... args)   T rdbuf (T... args)   T rdstate (T... args)   T register_callback (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 tie (T... args)   T unsetf (T... args)   T widen (T... args)   T width (T... args)   T xalloc (T... args)   - Public Member Functions inherited from ios_baseios_base (T... args)   T ~ios_base (T... args)   T flags (T... args)   T getloc (T... args)   T imbue (T... args)   T iword (T... args)   T precision (T... args)   T pword (T... args)   T register_callback (T... args)   T setf (T... args)   T sync_with_stdio (T... args)   T unsetf (T... args)   T width (T... args)   T xalloc (T... args)  

Detailed Description

A logger that outputs messages to a file.

Constructor & Destructor Documentation

◆ FileLogger()

FileLogger ( const std::string _filename = "")
explicit

Constructor.

Parameters
[in]_filenameFilename to write into. If empty, FileLogger::Init must be called separately.

◆ ~FileLogger()

virtual ~FileLogger ( )
virtual

Destructor.

Member Function Documentation

◆ Close()

void Close ( )

Close the open file handles.

◆ Init()

void Init ( const std::string _directory,
const std::string _filename 
)

Initialize the file logger.

Parameters
[in]_directoryName of directory that holds the log file.
[in]_filenameName of the log file to write output into.

◆ LogDirectory()

std::string LogDirectory ( ) const

Get the full path of the directory where all the log files are stored.

Returns
Full path of the directory.

◆ operator()() [1/2]

virtual FileLogger& operator() ( )
virtual

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

Returns
Reference to this logger.

◆ operator()() [2/2]

virtual FileLogger& 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: