LogCabin
Namespaces | Defines | Functions
Core/Debug.h File Reference
#include <cinttypes>
#include <cstdlib>
#include <string>
#include "include/LogCabin/Debug.h"

Go to the source code of this file.

Namespaces

namespace  LogCabin
namespace  LogCabin::Core
namespace  LogCabin::Core::StringUtil
namespace  LogCabin::Core::Debug

Defines

#define LOG(level, _format,...)
 Unconditionally log the given message to stderr.
#define PANIC(format,...)
 Log an ERROR message and abort the process.
#define EXIT(format,...)
 Log an ERROR message and exit the process with status 1.
#define ERROR(format,...)
 Log an ERROR message.
#define WARNING(format,...)
 Log a WARNING message.
#define NOTICE(format,...)
 Log a NOTICE message.
#define VERBOSE(format,...)
 Log a VERBOSE message.

Functions

std::string LogCabin::Core::StringUtil::format (const char *format,...)))
 A safe version of sprintf.
std::ostream & LogCabin::Core::Debug::operator<< (std::ostream &ostream, LogLevel level)
 Output a LogLevel to a stream.
bool LogCabin::Core::Debug::isLogging (LogLevel level, const char *fileName)
 Return whether the current logging configuration includes messages of the given level for the given filename.
void LogCabin::Core::Debug::log (LogLevel level, const char *fileName, uint32_t lineNum, const char *functionName, const char *message)
 Unconditionally log the given message to stderr.

Define Documentation

#define LOG (   level,
  _format,
  ... 
)

Unconditionally log the given message to stderr.

This is normally called by ERROR(), WARNING(), NOTICE(), or VERBOSE().

Parameters:
levelThe level of importance of the message.
_formatA printf-style format string for the message. It should not include a line break at the end, as LOG will add one.
...The arguments to the format string, as in printf.

Definition at line 101 of file Debug.h.

#define PANIC (   format,
  ... 
)

Log an ERROR message and abort the process.

Parameters:
formatA printf-style format string for the message. It should not include a line break at the end, as LOG will add one.
...The arguments to the format string, as in printf.

Definition at line 114 of file Debug.h.

#define EXIT (   format,
  ... 
)

Log an ERROR message and exit the process with status 1.

Parameters:
formatA printf-style format string for the message. It should not include a line break at the end, as LOG will add one.
...The arguments to the format string, as in printf.

Definition at line 123 of file Debug.h.

#define ERROR (   format,
  ... 
)

Log an ERROR message.

Parameters:
formatA printf-style format string for the message. It should not include a line break at the end, as LOG will add one.
...The arguments to the format string, as in printf.

Definition at line 136 of file Debug.h.

#define WARNING (   format,
  ... 
)

Log a WARNING message.

Parameters:
formatA printf-style format string for the message. It should not include a line break at the end, as LOG will add one.
...The arguments to the format string, as in printf.

Definition at line 143 of file Debug.h.

#define NOTICE (   format,
  ... 
)

Log a NOTICE message.

Parameters:
formatA printf-style format string for the message. It should not include a line break at the end, as LOG will add one.
...The arguments to the format string, as in printf.

Definition at line 150 of file Debug.h.

#define VERBOSE (   format,
  ... 
)

Log a VERBOSE message.

Parameters:
formatA printf-style format string for the message. It should not include a line break at the end, as LOG will add one.
...The arguments to the format string, as in printf.

Definition at line 157 of file Debug.h.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines