Gazebo Common

API Reference

3.17.0
gz/common/Console.hh File Reference
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <gz/common/Util.hh>
#include <gz/common/Export.hh>
#include <gz/common/SuppressWarning.hh>

Go to the source code of this file.

Classes

class  Logger::Buffer
 String buffer for the base logger. More...
 
class  FileLogger::Buffer
 String buffer for the file logger. More...
 
class  Console
 Container for loggers, and global logging options (such as verbose vs. quiet output). More...
 
class  FileLogger
 A logger that outputs messages to a file. More...
 
class  Logger
 Terminal logger. More...
 

Namespaces

 ignition
 Forward declarations for the common classes.
 
 ignition::common
 

Macros

#define igndbg   (ignition::common::Console::dbg(__FILE__, __LINE__))
 Output a debug message, if the verbose level is >= 4. More...
 
#define ignerr   (ignition::common::Console::err(__FILE__, __LINE__))
 Output an error message, if the verbose level is >= 1. More...
 
#define ignlog   (ignition::common::Console::log())
 Output a message to a log file, regardless of verbosity level. More...
 
#define ignLogClose()   ignition::common::Console::log.Close()
 Close the file used for logging. More...
 
#define ignLogDirectory()   (ignition::common::Console::log.LogDirectory())
 Get the full path of the directory where the log files are stored. More...
 
#define ignLogInit(_dir, _file)   ignition::common::Console::log.Init(_dir, _file)
 Initialize log file with filename given by _dir/_file. If called twice, it will close the file currently in use and open a new log file. More...
 
#define ignmsg   (ignition::common::Console::msg())
 Output a message, if the verbose level is >= 3. More...
 
#define ignwarn   (ignition::common::Console::warn(__FILE__, __LINE__))
 Output a warning message, if the verbose level is >= 2. More...
 

Macro Definition Documentation

◆ igndbg

#define igndbg   (ignition::common::Console::dbg(__FILE__, __LINE__))

Output a debug message, if the verbose level is >= 4.

◆ ignerr

#define ignerr   (ignition::common::Console::err(__FILE__, __LINE__))

Output an error message, if the verbose level is >= 1.

◆ ignlog

#define ignlog   (ignition::common::Console::log())

Output a message to a log file, regardless of verbosity level.

◆ ignLogClose

#define ignLogClose ( )    ignition::common::Console::log.Close()

Close the file used for logging.

◆ ignLogDirectory

#define ignLogDirectory ( )    (ignition::common::Console::log.LogDirectory())

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

Returns
Full path of the directory

◆ ignLogInit

#define ignLogInit (   _dir,
  _file 
)    ignition::common::Console::log.Init(_dir, _file)

Initialize log file with filename given by _dir/_file. If called twice, it will close the file currently in use and open a new log file.

Parameters
[in]_dirName of directory in which to store the log file. Note that if _dir is not an absolute path, then _dir will be relative to your home directory.
[in]_fileName of log file for ignlog messages.

◆ ignmsg

#define ignmsg   (ignition::common::Console::msg())

Output a message, if the verbose level is >= 3.

◆ ignwarn

#define ignwarn   (ignition::common::Console::warn(__FILE__, __LINE__))

Output a warning message, if the verbose level is >= 2.