Cogs.Foundation
Loading...
Searching...
No Matches
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.

Constructor & Destructor Documentation

◆ Log() [1/2]

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.

◆ Log() [2/2]

Cogs::Logging::Log::Log ( )
protecteddefault

Default constructor available to dervied types.

Member Function Documentation

◆ getName()

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

◆ log()

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

Log a formatted message.

References getName(), and 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.

References getName(), and 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.


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