FFmpegfs Fuse Multi Media Filesystem 2.16
Public Member Functions | Private Attributes | Static Private Attributes | List of all members
Logging::Logger Class Reference

Logging helper class. More...

Inheritance diagram for Logging::Logger:
Inheritance graph
[legend]
Collaboration diagram for Logging::Logger:
Collaboration graph
[legend]

Public Member Functions

 Logger (LOGLEVEL loglevel, const std::string &filename)
 Construct Logger object. More...
 
 Logger ()
 Construct Logger object. More...
 
virtual ~Logger ()
 Destroy Logger object. More...
 

Private Attributes

const LOGLEVEL m_loglevel
 Log level required to write log entry. More...
 
const std::string m_filename
 Name of file for which this log entry was written. May be empty. More...
 

Static Private Attributes

static const std::map< LOGLEVEL, int > m_syslog_level_map
 Map our log levels to syslog levels. More...
 
static const std::map< LOGLEVEL, std::string > m_level_name_map
 Map log level enums to strings. More...
 
static const std::map< LOGLEVEL, std::string > m_level_colour_map
 Map log level enums to colours (logging to stderr only) More...
 

Detailed Description

Logging helper class.

Definition at line 113 of file logging.h.

Constructor & Destructor Documentation

◆ Logger() [1/2]

Logging::Logger::Logger ( LOGLEVEL  loglevel,
const std::string &  filename 
)
inline

Construct Logger object.

Parameters
[in]loglevel- The maximum level of log output to write.
[in]filename- Name of file for which this log entry was written. May be empty.

Definition at line 121 of file logging.h.

◆ Logger() [2/2]

Logging::Logger::Logger ( )
inlineexplicit

Construct Logger object.

Definition at line 127 of file logging.h.

References LOGDEBUG.

◆ ~Logger()

Logging::Logger::~Logger ( )
virtual

Member Data Documentation

◆ m_filename

const std::string Logging::Logger::m_filename
private

Name of file for which this log entry was written. May be empty.

Definition at line 137 of file logging.h.

Referenced by ~Logger().

◆ m_level_colour_map

const std::map< Logging::LOGLEVEL, std::string > Logging::Logger::m_level_colour_map
staticprivate
Initial value:
=
{
}
#define COLOUR_GREEN
ANSI ESC for green foreground.
Definition: logging.cc:49
#define COLOUR_RED
ANSI ESC for red foreground.
Definition: logging.cc:47
#define COLOUR_WHITE
ANSI ESC for white foreground.
Definition: logging.cc:59
#define COLOUR_YELLOW
ANSI ESC for yellow foreground.
Definition: logging.cc:52
#define COLOUR_BLUE
ANSI ESC for blue foreground.
Definition: logging.cc:53
constexpr Logging::LOGLEVEL LOGDEBUG
Shorthand for log level DEBUG.
Definition: logging.h:459
constexpr Logging::LOGLEVEL LOGTRACE
Shorthand for log level TRACE.
Definition: logging.h:460
constexpr Logging::LOGLEVEL LOGWARN
Shorthand for log level WARNING.
Definition: logging.h:457
constexpr Logging::LOGLEVEL LOGERROR
Shorthand for log level ERROR.
Definition: logging.h:456
constexpr Logging::LOGLEVEL LOGINFO
Shorthand for log level INFO.
Definition: logging.h:458

Map log level enums to colours (logging to stderr only)

Definition at line 141 of file logging.h.

◆ m_level_name_map

const std::map< Logging::LOGLEVEL, std::string > Logging::Logger::m_level_name_map
staticprivate
Initial value:
=
{
{ LOGERROR, "ERROR " },
{ LOGWARN, "WARNING" },
{ LOGINFO, "INFO " },
{ LOGDEBUG, "DEBUG " },
{ LOGTRACE, "TRACE " },
}

Map log level enums to strings.

Definition at line 140 of file logging.h.

Referenced by ~Logger().

◆ m_loglevel

const LOGLEVEL Logging::Logger::m_loglevel
private

Log level required to write log entry.

Definition at line 135 of file logging.h.

Referenced by ~Logger().

◆ m_syslog_level_map

const std::map< Logging::LOGLEVEL, int > Logging::Logger::m_syslog_level_map
staticprivate
Initial value:
=
{
{ LOGERROR, LOG_ERR },
{ LOGWARN, LOG_WARNING },
{ LOGINFO, LOG_INFO },
{ LOGDEBUG, LOG_DEBUG },
{ LOGTRACE, LOG_DEBUG },
}

Map our log levels to syslog levels.

Definition at line 139 of file logging.h.

Referenced by ~Logger().


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