8#ifndef HPP_ALIB_LOX_LOX
9#define HPP_ALIB_LOX_LOX 1
11#if !defined(HPP_ALIB_ALOX)
12# error "ALib sources with ending '.inl' must not be included from outside."
50#include "alib/alox/detail/loxpimpl.inl"
52namespace alib {
namespace lox {
254 Priority priority = Priority::Standard )
258 trimReplacement, reach, priority );
278 bool allowAutoRule =
true )
410 Priority priority = Priority::Standard )
435 Priority priority = Priority::Standard )
734 const NString& loggerName =
nullptr )
739 #if defined (__GLIBCXX__) || defined(__APPLE__)
758 #if defined( _MSC_VER )
991 template <
typename... BoxedObjects>
1011 template <
typename... BoxedObjects>
1031 template <
typename... BoxedObjects>
1032 void Info( BoxedObjects&&... logables )
1051 template <
typename... BoxedObjects>
1071 template <
typename... BoxedObjects>
1072 void Error( BoxedObjects&&... logables )
1093 template <
typename... BoxedObjects>
1094 void Assert(
bool condition, BoxedObjects&&... logables )
1116 template <
typename... BoxedObjects>
1146 template <
typename... BoxedObjects>
1147 void If(
bool condition,
Verbosity verbosity, BoxedObjects&&... logables )
1221 const Box& logables,
1223 Scope scope= Scope::Global,
1331 Scope scope= Scope::Global ,
1384 detail::LI::once(
impl,
nullptr, Verbosity::Info, logables,
nullptr, Scope::Global, quantity );
1403 const String& group,
int quantity= 1 )
1429 #if ALIB_DEBUG_MONOMEM
This class acts as a container for Loggers and provides a convenient interface to logging.
ALIB_API Box Retrieve(Scope scope=Scope::Global)
void Error(BoxedObjects &&... logables)
void SetStartTime(const FILETIME &startTime, const NString &loggerName=nullptr)
void Info(BoxedObjects &&... logables)
void Once(const Box &logables, Scope scope, int quantity=1)
void Once(const Box &logables, int quantity=1)
BoxesMA & GetLogableContainer()
MonoAllocator & DbgGetMonoAllocator()
bool RemoveLogger(detail::Logger *logger)
detail::LoxImpl * impl
The implementation.
void SetVerbosity(detail::Logger *logger, Verbosity verbosity, const NString &domain="/", Priority priority=Priority::Standard)
void Store(const Box &data, Scope scope=Scope::Global)
void If(bool condition, Verbosity verbosity, BoxedObjects &&... logables)
detail::Logger * RemoveLogger(const NString &loggerName)
static ALIB_API textlogger::TextLogger * CreateConsoleLogger(const NString &name=nullptr)
void Entry(const NString &domain, Verbosity verbosity)
void SetPrefix(const Box &prefix, Scope scope, threads::Thread *thread)
void Once(Verbosity verbosity, const Box &logables, const String &group, int quantity=1)
void Once(const Box &logables, const String &group, int quantity=1)
void If(bool condition, const NString &domain, Verbosity verbosity, BoxedObjects &&... logables)
void SetFileNameCacheCapacity(integer numberOfLists, integer entriesPerList)
void Once(const NString &domain, Verbosity verbosity, const Box &logables, const String &group, Scope scope=Scope::Global, int quantity=1)
Lox(const NString &name, bool doRegister=true)
void State(const NString &domain, Verbosity verbosity, const String &headLine, StateInfo flags=StateInfo::All)
int IsActive(Verbosity verbosity, const NString &domain=NULL_NSTRING)
void Once(Verbosity verbosity, const Box &logables, const String &group, Scope scope, int quantity=1)
static constexpr NString InternalDomains
void SetStartTime(time_t startTime, const NString &loggerName=nullptr)
void RemoveThreadDomain(const NString &scopeDomain, Scope scope, threads::Thread *thread=nullptr)
void Store(const Box &data, const NString &key, Scope scope=Scope::Global)
void Verbose(BoxedObjects &&... logables)
void SetDomainSubstitutionRule(const NString &domainPath, const NString &replacement)
void SetPrefix(const Box &prefix, const NString &domain=nullptr, lang::Inclusion otherPLs=lang::Inclusion::Include)
integer & GetLogCounter()
void SetPrefix(const Box &prefix, Scope scope)
void SetSourcePathTrimRule(const NCString &path, lang::Inclusion includeString=lang::Inclusion::Exclude, int trimOffset=0, lang::Case sensitivity=lang::Case::Ignore, const NString &trimReplacement=NULL_NSTRING, lang::Reach reach=lang::Reach::Global, Priority priority=Priority::Standard)
void EntryDetectDomain(Verbosity verbosity, BoxedObjects &&... logables)
void MapThreadName(const String &threadName, threads::ThreadID id=0)
void SetDomain(const NString &scopeDomain, Scope scope)
void Assert(bool condition, BoxedObjects &&... logables)
void Once(Verbosity verbosity, const Box &logables, int quantity=1)
void Warning(BoxedObjects &&... logables)
void Once(const Box &logables, const String &group, Scope scope, int quantity=1)
ALIB_API Box Retrieve(const NString &key, Scope scope=Scope::Global)
const NString & GetName()
void Once(const NString &domain, Verbosity verbosity, const Box &logables, Scope scope=Scope::Global, int quantity=1)
void Acquire(const lang::CallerInfo &ci)
detail::Logger * GetLogger(const NString &loggerName)
void SetStartTime(Ticks startTime=time::Ticks(), const NString &loggerName=nullptr)
void ClearSourcePathTrimRules(lang::Reach reach=lang::Reach::Global, bool allowAutoRule=true)
void GetState(NAString &buf, StateInfo flags=StateInfo::All)
void Once(Verbosity verbosity, const Box &logables, Scope scope, int quantity=1)
void SetVerbosity(const NString &loggerName, Verbosity verbosity, const NString &domain="/", Priority priority=Priority::Standard)
void SetDomain(const NString &scopeDomain, Scope scope, threads::Thread *thread)
#define ALIB_ENUMS_MAKE_BITWISE(TEnum)
#define ALIB_ENUMS_ASSIGN_RECORD(TEnum, TRecord)
Inclusion
Denotes how members of a set something should be taken into account.
@ Exclude
Chooses exclusion.
@ Include
Chooses inclusion.
Reach
Denotes the reach of something.
@ Global
Denotes global reach.
Case
Denotes upper and lower case character treatment.
This namespaces defines class TextLogger and its helpers.
@ ScopeDomains
Scope domains.
@ CompilationFlags
ALib/ALox compilation flags
@ DSR
Domain substitution rules.
@ InternalDomains
Internal domains.
@ Version
Library Version and thread safeness.
@ PrefixLogables
Prefix logables.
@ Domains
Log domains currently registered.
@ LogData
Log data objects.
@ Basic
Name and number of log calls.
@ SPTR
Source path trim rules.
@ ThreadMappings
Named threads.
integer ThreadID
The ALib thread identifier type.
constexpr NString NULL_NSTRING
A nulled string of the narrow character type.
lox::textlogger::TextLogger TextLogger
Type alias in namespace alib.
lox::detail::Logger Logger
Type alias in namespace alib.
lang::integer integer
Type alias in namespace alib.
static ALIB_API void Reset(LoxImpl *impl)
static ALIB_API void SetVerbosity(LoxImpl *impl, detail::Logger *logger, Verbosity verbosity, const NString &domain, Priority priority)
static ALIB_API void entryDetectDomainImpl(LoxImpl *impl, Verbosity verbosity)
static ALIB_API void SetStartTime(LoxImpl *impl, Ticks startTime, const NString &loggerName)
static ALIB_API void Acquire(LoxImpl *impl, const lang::CallerInfo &ci)
static ALIB_API void SetDomainSubstitutionRule(LoxImpl *impl, const NString &domainPath, const NString &replacement)
static ALIB_API void setDomain(LoxImpl *impl, const NString &scopeDomain, Scope scope, bool removeNTRSD, threads::Thread *thread)
static ALIB_API detail::Logger * GetLogger(LoxImpl *impl, const NString &loggerName)
static ALIB_API void SetFileNameCacheCapacity(LoxImpl *impl, integer numberOfLists, integer entriesPerList)
static ALIB_API void RemoveThreadDomain(LoxImpl *impl, const NString &scopeDomain, Scope scope, threads::Thread *thread)
static ALIB_API bool RemoveLogger(LoxImpl *impl, detail::Logger *logger)
static ALIB_API void store(LoxImpl *impl, const Box &data, const NString &pKey, Scope scope)
static ALIB_API void Release(LoxImpl *impl)
static ALIB_API void IncreaseLogCounter(LoxImpl *impl)
static ALIB_API void Construct(Lox *lox, const NString &name, bool doRegister)
static ALIB_API void setPrefix(LoxImpl *impl, const Box &prefix, Scope scope, threads::Thread *thread)
static ALIB_API void GetState(LoxImpl *impl, NAString &buf, StateInfo flags)
static ALIB_API void MapThreadName(LoxImpl *impl, const String &threadName, threads::ThreadID id)
static ALIB_API void State(LoxImpl *impl, const NString &domain, Verbosity verbosity, const String &headLine, StateInfo flags)
static ALIB_API void Destruct(Lox *lox)
static ALIB_API Box retrieve(LoxImpl *impl, const NString &pKey, Scope scope)
static ALIB_API integer & GetLogCounter(LoxImpl *impl)
static ALIB_API const NString & GetName(LoxImpl *impl)
static ALIB_API void Entry(LoxImpl *impl, const NString &domain, Verbosity verbosity)
static ALIB_API MonoAllocator & DbgGetMonoAllocator(LoxImpl *impl)
static ALIB_API void once(LoxImpl *impl, const NString &domain, Verbosity verbosity, const Box &logables, const String &pGroup, Scope scope, int quantity)
static ALIB_API BoxesMA & GetLogableContainer(LoxImpl *impl)
static ALIB_API void SetPrefix(LoxImpl *impl, const Box &prefix, const NString &domain, lang::Inclusion otherPLs)
static ALIB_API void SetSourcePathTrimRule(LoxImpl *impl, const NCString &path, lang::Inclusion includeString, int trimOffset, lang::Case sensitivity, const NString &trimReplacement, lang::Reach reach, Priority priority)
static ALIB_API int IsActive(LoxImpl *impl, Verbosity verbosity, const NString &domain)