Cogs.Foundation
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Typedefs | Enumerations | Functions
LogManager.h File Reference
#include "../StringView.h"
#include <cstdarg>

Go to the source code of this file.

Classes

class  Cogs::Logging::Log
 Log implementation class. More...
 

Namespaces

namespace  Cogs
 Main Cogs namespace.
 
namespace  Cogs::Logging
 Contains logging functionality for the Cogs native library.
 

Macros

#define _Printf_format_string_
 
#define VALIDATE_ARGS(a)   __attribute__((format(printf, a, a+1)))
 

Typedefs

using Cogs::Logging::LoggerCallback = void(const char *message, const char *source, int category)
 Definition of logging callback.
 
using Cogs::Logging::FileLineLoggerCallback = void(const char *file, int line, const char *message, const char *source, int category)
 Definition of logging callback including file and line information.
 

Enumerations

enum class  Cogs::Logging::Category {
  Cogs::Logging::Trace = 0 , Cogs::Logging::Debug , Cogs::Logging::Info , Cogs::Logging::Warning ,
  Cogs::Logging::Error , Cogs::Logging::Fatal
}
 Logging categories used to filter log messages. More...
 
enum  Cogs::Logging::ErrorGroup : uint32_t {
  Cogs::Logging::Unspecified , Cogs::Logging::FirstFoundation = 0x00100000 , Cogs::Logging::FoundationIO = 0x00110000 , Cogs::Logging::FoundationModule = 0x00120000 ,
  Cogs::Logging::FoundationNetwork = 0x00130000 , Cogs::Logging::FirstRendering = 0x01000000 , Cogs::Logging::FirstCore = 0x10000000 , Cogs::Logging::FirstDesktop = 0x20000000 ,
  Cogs::Logging::FirstTerrain = 0x30000000 , Cogs::Logging::FirstCoreExtension = 0x40000000 , Cogs::Logging::FirstExternalExtension = 0x90000000 , Cogs::Logging::FirstThirdParty = 0xB0000000 ,
  Cogs::Logging::NvidiaCUDA = 0xB0010000 , Cogs::Logging::NvidiaNvEnc = 0xB0020000 , Cogs::Logging::FirstApplication = 0xC0000000
}
 ErrorGroup values define the top 16-bits of module specific error numbers. More...
 

Functions

void COGSFOUNDATION_API Cogs::Logging::setLoggerCategory (Category category)
 Sets the default category level for loggers created after this call.
 
void COGSFOUNDATION_API Cogs::Logging::updateLoggerCategory (Category category)
 
void Cogs::Logging::updateMinimumCategory ()
 Internal.
 
void COGSFOUNDATION_API Cogs::Logging::enableUnhandledExceptionLogging ()
 Enable catching and logging of hardware exceptions (crashes) before exiting. (Windows only - for now.)
 
void COGSFOUNDATION_API Cogs::Logging::registerConsumer (Consumer *consumer)
 Registers the specified consumer with the LogManager.
 
void COGSFOUNDATION_API Cogs::Logging::unregisterConsumer (Consumer *consumer)
 Removes the specified consumer from the LogManager.
 
void COGSFOUNDATION_API Cogs::Logging::log (const char *message, const char *source, const Category category, uint32_t errorNumber)
 Logs the given message with source and category.
 
void COGSFOUNDATION_API Cogs::Logging::log (const char *source, const Category category, uint32_t errorNumber, _Printf_format_string_ const char *fmt,...) VALIDATE_ARGS(4)
 Logs the given formatted string (using printf formatting rules) with source and category.
 
void COGSFOUNDATION_API Cogs::Logging::logFileLine (const char *file, const int line, const char *source, const Category category, uint32_t errorNumber, _Printf_format_string_ const char *fmt,...) VALIDATE_ARGS(6)
 Logs the given formatted string (using printf formatting rules) with file/line information and source and category.
 
void COGSFOUNDATION_API Cogs::Logging::logArgs (const char *source, const Category category, uint32_t errorNumber, const char *fmt, va_list args)
 Log the given formatted string with argument list.
 
void COGSFOUNDATION_API Cogs::Logging::logFileLineArgs (const char *file, const int line, const char *source, const Category category, uint32_t errorNumber, const char *fmt, va_list args)
 Log the given formatted string with argument list and file/line information.
 
Category COGSFOUNDATION_API Cogs::Logging::parseCategoryString (const StringView category)
 Utility function that takes a loglevel name as a string and returns the corresponding log level enum value.
 
bool COGSFOUNDATION_API Cogs::Logging::isErrorGroup (uint32_t errorNumber, ErrorGroup group)
 Tests whether the specified error number is from the given group.
 
template<size_t LEN>
constexpr Log Cogs::Logging::getLogger (const char(&name)[LEN]) noexcept
 

Macro Definition Documentation

◆ _Printf_format_string_

#define _Printf_format_string_

◆ VALIDATE_ARGS

#define VALIDATE_ARGS (   a)    __attribute__((format(printf, a, a+1)))