Cogs.Core
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Cogs::Logging::Log Class Reference

Log implementation class. More...

#include <LogManager.h>

Public Member Functions

template<size_t LEN>
constexpr Log (const char(&n)[LEN]) noexcept
 
void logFileLine (const char *file, const int line, const Category category, uint32_t errorNumber, _Printf_format_string_ const char *fmt,...) const VALIDATE_ARGS(6)
 Log a formatted message with file/line information.
 
void log (const Category category, uint32_t errorNumber, _Printf_format_string_ const char *fmt,...) const VALIDATE_ARGS(4)
 Log a formatted message.
 
constexpr const char * getName () const noexcept
 

Protected Member Functions

 Log ()=default
 Default constructor available to dervied types.
 

Protected Attributes

const char * literalName = nullptr
 

Detailed Description

Log implementation class.

The log provides an easy way to share a logging source in a class, namespace or similar.

Definition at line 139 of file LogManager.h.

Constructor & Destructor Documentation

◆ Log()

template<size_t LEN>
constexpr Cogs::Logging::Log::Log ( const char(&)  n[LEN])
inlineexplicitconstexprnoexcept

Creates a new instance of the Log class.

Parameters
n- Name of the log used to identify output produced through this instance.

Definition at line 145 of file LogManager.h.

Member Function Documentation

◆ getName()

constexpr const char * Cogs::Logging::Log::getName ( ) const
inlineconstexprnoexcept

Definition at line 165 of file LogManager.h.

◆ log()

void Cogs::Logging::Log::log ( const Category  category,
uint32_t  errorNumber,
_Printf_format_string_ const char *  fmt,
  ... 
) const
inline

Log a formatted message.

Definition at line 157 of file LogManager.h.

References Cogs::Logging::logArgs().

◆ logFileLine()

void Cogs::Logging::Log::logFileLine ( const char *  file,
const int  line,
const Category  category,
uint32_t  errorNumber,
_Printf_format_string_ const char *  fmt,
  ... 
) const
inline

Log a formatted message with file/line information.

Definition at line 148 of file LogManager.h.

References Cogs::Logging::logFileLineArgs().

Member Data Documentation

◆ literalName

const char* Cogs::Logging::Log::literalName = nullptr
protected

Used for the case where a string literal was passed in. OK as string literals are valid for program duration.

Definition at line 172 of file LogManager.h.


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