ALib C++ Library
Library Version: 2402 R1
Documentation generated by doxygen
Loading...
Searching...
No Matches
lox.inl
Go to the documentation of this file.
1/** ************************************************************************************************
2 * \file
3 * This header file is part of module \alib_alox of the \aliblong.
4 *
5 * \emoji :copyright: 2013-2024 A-Worx GmbH, Germany.
6 * Published under \ref mainpage_license "Boost Software License".
7 **************************************************************************************************/
8#ifndef HPP_ALOX_LOX
9#define HPP_ALOX_LOX 1
10
11#if !defined(HPP_ALIB_ALOX)
12# error "ALib sources with ending '.inl' must not be included from outside."
13#endif
14
15#if !defined (HPP_ALIB_ENUMS_BITWISE)
16 #include "alib/enums/bitwise.hpp"
17#endif
18
20
21
22
23namespace alib { namespace lox { namespace detail {
24
25 class Logger;
26
27 namespace textlogger
28 {
29 class TextLogger;
30 }
31} // namespace alib::lox[::detail]
32
33
34
35/**
36 * Denotes flags used with methods \alib{lox;Lox::GetState} and \alib{lox;Lox::State} to select
37 * different parts of the state receive.
38 */
39enum class StateInfo
40{
41 NONE = 0, ///< No state
42 Basic = 1 << 0, ///< Name and number of log calls
43 Version = 1 << 1, ///< Library Version and thread safeness
44 Loggers = 1 << 2, ///< Loggers
45
46 Domains = 1 << 3, ///< Log domains currently registered
47 InternalDomains = 1 << 4, ///< Internal domains
48 ScopeDomains = 1 << 5, ///< Scope domains
49 DSR = 1 << 6, ///< Domain substitution rules
50 PrefixLogables = 1 << 7, ///< Prefix logables
51 Once = 1 << 8, ///< Log once counters
52 LogData = 1 << 9, ///< Log data objects
53 ThreadMappings = 1 << 10, ///< Named threads
54
55 SPTR = 1 << 20, ///< Source path trim rules
56 CompilationFlags = 1 << 21, ///< \alib/\alox compilation flags
57
58 All = ~0L,
59};
60
61}} // namespace [alib::lox]
62
64
65#include "alib/alox/detail/loxpimpl.inl"
66
67namespace alib { namespace lox {
68
69/** ************************************************************************************************
70 * This class acts as a container for \e Loggers and provides a convenient interface to logging.
71 * Fore information how to use this class, checkout the \alox tutorials and the ALox manual.
72 *
73 * If thread safeness is not needed for the logging system (see user manual),
74 * the mutex can be switched off using inherited method \alib{threads;ThreadLock::SetSafeness}.
75 * The goal here would be to increase logging performance. This is really a very
76 * seldom case when performance is absolutely key, and it is better to be kept in safe mode.
77 *
78 * <b>'Logable Objects' in <em>%ALox for C++</em></b><br>
79 * While other \alox implementations, like ALox for C# or ALox for Java use the 'run-time type
80 * information' feature of their underlying programming language to identify any object type,
81 * in the C++ version
82 * \ref alib::boxing "%ALib Boxing" is used to be able to log arbitrary object types.
83 **************************************************************************************************/
84class Lox
85{
86 #if !defined(ALIB_DOX)
87 friend class ALox;
88 friend struct detail::LI;
89 #endif
90
91 protected:
92 /** The implementation. */
94
95 public:
96 /**
97 * This is the path for logging to the internal domain. By manipulating this
98 * <em>%Log %Domain's %Verbosity</em>, the verbosity of \alox itself can be controlled.
99 * For example, with \e Verbosity.INFO, the 'on the fly' creation of <em>Log Domains</em>
100 * are logged, which can be helpful to determine the <em>Lo bg Domains</em> that are
101 * created by libraries and larger projects.
102 *
103 * The following sub-domains are used by \alox:
104 *
105 * Sub-Domain | Description
106 * - - - - - -| - - - - - - - - - - - - - - - - - - -
107 * LGR | Used when \e %Loggers are registered, retrieved or removed from a \b %Lox and when the \e Verbosity of a <em>Log Domain</em> for a \e %Logger is changed.<br>In addition used with method \b %Lox::SetStartTime.
108 * DMN | Used when <em>Log Domains</em> are registered (on first use), when <em>Scope Domains</em> are set or removed and when <em>Domain Substitution Rules</em> are set.
109 * PFX | Used when <em>Prefix Logables</em> are set or removed.
110 * THR | Used with method \b %Lox::MapThreadName.
111 * LGD | Used with storing and retrieving <em>Log Data</em> objects.
112 *
113 * In addition, class \alox{ALoxReportWriter} logs into sub-domain <c>'REPORT'</c>.
114 *
115 * \note For internal logging an separated <em>domain tree</em> is used. This means, that
116 * setting the root domain of a \b %Lox to a certain \e Verbosity does \e not affect
117 * the internal domains. In other words, the \e Verbosity of the internal domain
118 * (or one of its sub-domains) has to be set explicitly.
119 *
120 */
121 static constexpr NString InternalDomains { "$/" };
122
123
124
125 // #############################################################################################
126 // Constructors/destructor
127 // #############################################################################################
128 public:
129 /** ****************************************************************************************
130 * Constructs a new, empty Lox with the given \p{name}.
131 * The name is immutable and all \b %Lox objects registered with \alox must be unique.
132 * Lower case letters in the name are converted to upper case.
133 * The name \c "Log" is reserved for the internal default singleton used for debug-logging.
134 * In addition, name \c "GLOBAL" is not allowed.
135 *
136 * If parameter \p{register} is \c true (the default), static method
137 * \ref alib::lox::ALox::Register "ALox::Register" is invoked and the object will be
138 * retrievable with static method
139 * \ref alib::lox::ALox::Get "ALox::Get". In some situations, such 'registration'
140 * may not be wanted.
141 *
142 * @param name The name of the Lox. Will be copied and converted to upper case.
143 * @param doRegister If \c true, this object is registered with static class
144 * \ref alib::lox::ALox "ALox".
145 * Optional and defaults to \c true.
146 ******************************************************************************************/
147 Lox(const NString& name, bool doRegister =true )
148 {
149 detail::LI::Construct( this, name, doRegister );
150 }
151
152 /** ****************************************************************************************
153 * Destructs a lox
154 ******************************************************************************************/
156 {
158 }
159
160 // #############################################################################################
161 // Interface
162 // #############################################################################################
163 public:
164 /** ****************************************************************************************
165 * Returns the name of this \b %Lox. The name user defined, provided in the constructor,
166 * converted to upper case and otherwise immutable.
167 *
168 * @returns The name of this %Lox.
169 ******************************************************************************************/
171 {
172 return detail::LI::GetName( impl );
173 }
174
175 /** ****************************************************************************************
176 * Returns the number of logs that have been performed with this \b Lox.
177 * The counter is not used internally other than for providing a
178 * unique log number: While each logger attached has a own number, if more than one
179 * logger is attached, their numbers may differ due to different log domain settings.
180 * \note
181 * The result is given as a mutual reference to the internal counter, which is allowed
182 * to be manipulated. This is for example used in unit tests.
183 *
184 * @returns \c true if this instance was registered with \alox, \c false if not.
185 ******************************************************************************************/
190
191 /** ***************************************************************************************
192 * Acquires this \b %Lox and sets the scope information data for the next log.
193 *
194 * @param file The name of the source code file that the call is placed in.
195 * Usually the predefined preprocessor macro __FILE__ is passed here.
196 * @param line The line number within the source code file that the call is placed in.
197 * Usually the predefined preprocessor macro __LINE__ is passed here.
198 * @param func The name of the function that the call is placed in.
199 * Usually the predefined preprocessor macro __func__ (or __FUNCTION__) is passed here.
200 **************************************************************************************/
201 void Acquire( const NCString& file, int line, const NCString& func )
202 {
203 detail::LI::Acquire(impl, file, line, func);
204 }
205
206 /** ****************************************************************************************
207 * Releases ownership of this object. If #Acquire was called multiple times, the same
208 * number of calls to this method have to be performed to release ownership.
209 ******************************************************************************************/
210 void Release()
211 {
213 }
214
215 /** ****************************************************************************************
216 * Resets this object. Concretely the following steps are performed:
217 * - All loggers are removed
218 * - All domain settings are cleared
219 * - Scope Domains are cleared
220 * - Log data is cleared
221 * - Log once counters are cleared
222 * - The thread dictionary is cleared.
223 * - All Trim domains cleared
224 *
225 * \attention
226 * This method was introduced to support resetting the debug \b %Lox objects in the unit
227 * tests. In real applications, and for release logging it recommended to delete a Lox
228 * and create a new one instead of resetting one.
229 * Side effects might appear using this method!
230 *
231 * @param reInitialze If called from the destructor \c false is passed.
232 * Defaults to \c true and must not be set by callers.
233 ******************************************************************************************/
234 void Reset(bool reInitialze= true)
235 {
236 detail::LI::Reset(impl, reInitialze);
237 }
238
239 /** ****************************************************************************************
240 * Adds \p{path} to an internal list of sub-strings that are used to trim the path of
241 * a source file name. Trimmed paths are used for \e Scope mechanisms and can be
242 * logged (e.g. with meta information of class \b TextLogger.
243 *
244 * By default such setting affects all instances of class \b Lox, not only
245 * this instance. This can be altered using parameter \p{global}.
246 * one other The given trim information can either
247 *
248 * If given \p{path} starts with character <c> '*'</c>, the rest of the string is searched
249 * within source paths. Otherwise, it is checked if a source path starts with the given
250 * path.
251 *
252 * Parameter \p{trimReplacement} optionally provides a replacement string for the trimmed
253 * path. This can be used for example to provide the right absolute path for an IDE
254 * to find source files of a library.
255 *
256 * Parameter \p{includeString} determines if the searched sub-string should be included in the
257 * resulting source path or not. In addition, parameter \p{trimOffset}, which can be negative
258 * or positive, is added to the position of trimming. This can be used to increase the
259 * length of the search path, and then cut only a portion of what was searched for.
260 *
261 * Finally, parameter \p{sensitivity} determines whether the match is performed case
262 * sensitive or not. It defaults to non-sensitive, for convenience and for the fact that
263 * for example Microsoft C++ compiler's preprocessor passes lower case path-strings!
264 *
265 * \note
266 * If the platform (compiler) specific path separator is <c>'/'</c>, then characters
267 * <c>'\'</c> found in parameters \p{path} and \p{trimReplacement} are replaced by <c>'\'</c>
268 * and vice versa. This allows to specify paths and sub-strings thereof in a platform
269 * independent way.
270 *
271 * \attention
272 * Setting global rules (when parameter \p{global} equals \c Inclusion::Include) is not
273 * protected by a \c mutex against concurrent access. Therefore, global rules have
274 * to be either at bootstrap of a process, before threads are created, or such creation
275 * has to 'manually' be protected by locking all existing instances of this class!
276 *
277 * @param path The path to search for. If not starting with <c> '*'</c>,
278 * a prefix is searched.
279 * @param includeString Determines if \p{path} should be included in the trimmed path or
280 * not.
281 * Optional and defaults to \b %Inclusion::Exclude.
282 * @param trimOffset Adjusts the portion of \p{path} that is trimmed.
283 * Optional and defaults to \c 0.
284 * @param sensitivity Determines if the comparison of \p{path} with a source file's path
285 * is performed case sensitive or not.
286 * Optional and defaults to \b Case::Ignore.
287 * @param trimReplacement Replacement string for trimmed portion of the path.
288 * Optional and defaults to \b %NullString().
289 * @param reach Denotes whether the rule is applied locally (to this \b %Lox only)
290 * or applies to all instances of class \b %Lox.
291 * Defaults to \b %Reach::Global.
292 * @param priority The priority of the setting. Defaults to
293 * \ref alib::config::Priorities "Priorities::DefaultValues".
294 ******************************************************************************************/
297 int trimOffset = 0,
298 lang::Case sensitivity = lang::Case::Ignore,
299 const NString& trimReplacement = NullNString(),
301 Priorities priority = Priorities::DefaultValues )
302
303 {
304 detail::LI::SetSourcePathTrimRule( impl, path, includeString, trimOffset, sensitivity,
305 trimReplacement, reach, priority );
306 }
307
308
309 /** ****************************************************************************************
310 * Removes all local trimming rules set with #SetSourcePathTrimRule.
311 * If parameter \p{global} is set to \b Inclusion::Include, the global rules are cleared
312 * in addition.
313 *
314 * Setting parameter \p{allowAutoRule} to \c false, allows to suppress the creation of an
315 * automatic rule based on the executables path.
316 *
317 * \see Chapter \ref alib_mod_trim_source_path for more information.
318 *
319 * @param reach Denotes whether only local rules are cleared or also global ones.
320 * Defaults to \b %Reach::Global.
321 * @param allowAutoRule Determines if an auto rule should be tried to be detected next
322 * no appropriate rule is found.
323 ******************************************************************************************/
325 bool allowAutoRule = true )
326 {
329 999999, // code for clearing
330 lang::Case::Ignore, NullNString(), reach, Priorities::NONE );
331 }
332
333 /** ****************************************************************************************
334 * This static method creates a console logger. To decide which logger type to choose,
335 * configuration variable \ref alxcvALOX_CONSOLE_TYPE is checked. If this variable is not set,
336 * then the decision is made as follows:
337 * - On GNU/Linux OS, a
338 * \ref alib::lox::loggers::AnsiConsoleLogger "AnsiConsoleLogger" is chosen.
339 * - On Windows OS, if a console window is attached, type
340 * \ref alib::lox::loggers::WindowsConsoleLogger "WindowsConsoleLogger" is chosen. If
341 * no console is attached to the process, instead a
342 * \ref alib::lox::loggers::ConsoleLogger "ConsoleLogger" is returned.
343 *
344 *
345 * @param name The name of the \e Logger. Defaults to nullptr, which implies standard
346 * logger names defined in the \e Logger sub-classes.
347 *
348 * @return An instance of the chosen console type logger.
349 ******************************************************************************************/
350 ALIB_API static
352
353 /** ****************************************************************************************
354 * Retrieves an instance of a Logger by its name. This might be useful when access to a
355 * \e %Logger is needed to change its configuration.
356 *
357 * @param loggerName The name of the \e Logger to search for (case insensitive).
358 * @return The logger, nullptr if not found.
359 ******************************************************************************************/
360 detail::Logger* GetLogger( const NString& loggerName )
361 {
362 return detail::LI::GetLogger(impl, loggerName);
363 }
364
365 /** ****************************************************************************************
366 * Removes a logger from this container.
367 * \note
368 * To (temporarily) disable a logger without removing it, a call to
369 * \ref SetVerbosity(detail::Logger*,Verbosity,const NString&,Priorities) "SetVerbosity(logger, Verbosity::Off)"
370 * can be used.
371 *
372 * @param logger The logger to be removed.
373 * @returns \c true, if the \e Logger was found and removed, \c false otherwise.
374 ******************************************************************************************/
376 {
377 return detail::LI::RemoveLogger(impl, logger);
378 }
379
380 /** ****************************************************************************************
381 * Removes logger named \p{loggerName} from this container.
382 * \note
383 * To (temporarily) disable a logger without removing it, a call to
384 * \ref SetVerbosity(detail::Logger*,Verbosity,const NString&,Priorities) "SetVerbosity(logger, Verbosity::Off)"
385 * can be used.
386 *
387 * @param loggerName The name of the \e Logger(s) to be removed (case insensitive).
388 * @returns The logger that was removed, \c nullptr if not found.
389 ******************************************************************************************/
390 detail::Logger* RemoveLogger( const NString& loggerName )
391 {
392 return detail::LI::RemoveLogger(impl, loggerName);
393 }
394
395 /** ****************************************************************************************
396 * Sets the \e %Verbosity of the <em>Log Domain</em> which is evaluated from parameter
397 * \p{domain} and applicable <em>Scope Domains</em>. The \p{verbosity} given is set
398 * recursively for all sub-domains.
399 *
400 * With the first invocation of this method for a distinct \p{logger}, this \e %Logger
401 * is registered with this \e %Lox. In this case, prior to setting the given \e Verbosity
402 * for the evaluated sub-domain, the \e Verbosity for all domains is set to
403 * \b %Verbosity::Off.
404 *
405 * To deregister a \e Logger with a \b Lox, use method #RemoveLogger.
406 * To 'disable' a \e Logger, invoke this method with parameters \p{verbosity} equaling to
407 * \b %Verbosity::Off and \p{domain} to \c "/".
408 *
409 * Optional parameter \p{priority} defaults to
410 * \ref alib::config::Priorities "Priorities::DefaultValues",
411 * which is a lower priority than those of the standard plug-ins of external configuration
412 * data. Therefore, external configuration by default 'overwrite' settings made from
413 * 'within the source code', which simply means by invoking this method.<br>
414 * The parameter can be provided for two main reasons:
415 * - To 'lock' a verbosity setting against external manipulation.
416 * - to 'break' the standard mechanism that an invocation of this method sets all
417 * sub-domains recursively. If a sub-domain was set with a higher priority
418 * (e.g. <c>%Config::PriorityOf(Priorities::DefaultValues) + 1</c>, then this sub-domain will not be affected
419 * by future invocations of this method with standard-priority given.
420 *
421 * For more information on how to use external configuration variables with priority and
422 * on protecting verbosity settings, consult the \ref alib_mod_alox.
423 *
424 * \attention
425 * The same as with most interface methods of this class, the given \p{domain} parameter is
426 * combined with <em>%Scope Domains</em> set for the caller's \e %Scope. In standard use
427 * cases of %ALox, the \e %Verbosity of a \e Domain is set using absolute domain path
428 * addressing. Therefore, it is recommended to have any domain path passed to this method
429 * starting with <c> '/'</c>, which suppresses the concatenation of <em>%Scope Domains</em>.<br>
430 * This is why this parameter with this method defaults to <c> '/'</c>, while with other
431 * methods of this class, it defaults to an empty string.
432 * <p>
433 * \attention
434 * Even when using an absolute domain path, <em>%Scope Domains</em> of
435 * \e %Scope::ThreadInner, will still apply. This means that from within a thread that
436 * has such <em>%Scope Domain</em> set, this method is (almost) not usable!
437 * This all aligns with the concept (advice), that \e Loggers and their \e %Verbosity
438 * are generally set outside of such scopes, hence in configuration sections of a
439 * process.<p>
440 * \attention
441 * Consequently, this method may be (mis-) used to modify the 'actual' (default) scope
442 * when explicitly giving an empty string with parameter \p{domain}. This is useful, to
443 * temporarily adjust a scope. But remember: \alox was designed to avoid temporary
444 * code lines...
445 *
446 * @param logger The logger to be to be affected (case insensitive).
447 * @param verbosity The 'level of verboseness' to be set.
448 * @param domain The parent (start) domain to be set. The use of absolute paths
449 * starting with <c> '/'</c> are recommended.
450 * Defaults to root domain \"/\".
451 * @param priority The priority of the setting. Defaults to
452 * \ref alib::config::Priorities "Priorities::DefaultValues".
453 ******************************************************************************************/
455 Verbosity verbosity,
456 const NString& domain = "/",
457 Priorities priority = Priorities::DefaultValues )
458 {
459 detail::LI::SetVerbosity(impl, logger, verbosity, domain, priority);
460 }
461
462 /** ****************************************************************************************
463 * Same as \ref #SetVerbosity(detail::Logger*,Verbosity,const NString&,Priorities) "SetVerbosity"
464 * but addressing the \e %Logger to manipulate by its name.<br>
465 * This method may only be used after a \e %Logger was once 'registered' with this \b %Lox
466 * using \ref #SetVerbosity(detail::Logger*,Verbosity,const NString&,Priorities) "SetVerbosity".
467 *
468 * @param loggerName The logger to be to be affected, identified by its name (case
469 * insensitive).
470 * @param verbosity The 'level of verboseness' to be set.
471 * @param domain The parent (start) domain to be set. The use of absolute paths
472 * starting with <c> '/'</c> are recommended.
473 * Defaults to root domain \"/\".
474 * @param priority The priority of the setting. Defaults to
475 * \ref alib::config::Priorities "Priorities::DefaultValues".
476 ******************************************************************************************/
477 void SetVerbosity( const NString& loggerName,
478 Verbosity verbosity,
479 const NString& domain = "/",
480 Priorities priority = Priorities::DefaultValues )
481 {
482 detail::LI::SetVerbosity(impl, loggerName, verbosity, domain, priority);
483 }
484
485 /** ****************************************************************************************
486 * The given \p{scopeDomain} becomes the default domain path for given \p{scope}.
487 * This means, that any subsequent log invocations (from within this same scope) can omit
488 * the domain parameter, or if they provide one, this Scope Domain path is prepended.
489 * If subsequent log calls specify a domain name with a leading '/' character,
490 * then the Scope Domain of the scope is ignored.<br>
491 * Furthermore, if the given scope is an inner scope, outer scopes are prepended to the
492 * given \p{scopeDomain} when the resulting domain of a log invocation is evaluated.
493 * Again, this behavior can be overruled by prepending a leading '/' character to
494 * \p{scopeDomain}.
495 *
496 * To remove a previously set Scope Domain a \e nulled or empty string has to be passed with
497 * parameter \p{scopeDomain}.
498 * For \e %Scope::ThreadOuter and \e %Scope::ThreadInner, passing an empty or \e nulled
499 * string removes the most recently added domain path. For removing an explicitly named
500 * domain path of \e %Scope::ThreadOuter and \e %Scope::ThreadInner use method
501 * #RemoveThreadDomain.
502 *
503 * \note
504 * The C++ version of \alox implements scope mechanisms using scope information generated
505 * by the preprocessor. By default, debug logging supports such caller information,
506 * release logging does not. This can be changed.<br>
507 * For more information on how to change such defaults, see documentation of preprocessor
508 * symbols \ref ALOX_DBG_LOG_CI and \ref ALOX_REL_LOG_CI.
509 *
510 * @param scopeDomain The domain path to register.
511 * @param scope The scope that should the given \p{domain} be registered for.
512 * Available Scope definitions are platform/language dependent.
513 ******************************************************************************************/
514 void SetDomain( const NString& scopeDomain, Scope scope )
515 {
516 detail::LI::setDomain(impl, scopeDomain, scope, false, nullptr );
517 }
518
519 /** ****************************************************************************************
520 * This overloaded version of
521 * \ref SetDomain(const NString&,Scope) "SetDomain" is applicable only for
522 * \e %Scope::ThreadOuter and \e %Scope::ThreadInner and allows to specify the thread that
523 * the setting should be associated with.
524 *
525 * If \p{scopeDomain} is nullptr or empty, the most recently added domain path is removed.
526 * For removing an explicitly named domain associated with a thread use method
527 * #RemoveThreadDomain.
528 *
529 * @param scopeDomain The domain path to register.
530 * @param scope Either \e %Scope::ThreadOuter or \e %Scope::ThreadInner. With other
531 * values, an internal error is logged.
532 * @param thread The thread to set/unset a thread-related Scope Domains for.
533 ******************************************************************************************/
534 void SetDomain( const NString& scopeDomain, Scope scope, threads::Thread* thread )
535 {
536 detail::LI::setDomain( impl, scopeDomain, scope, false, thread );
537 }
538
539 /** ****************************************************************************************
540 * Adds a <em>Domain Substitution Rule</em>.
541 * <em>Domain Substitution</em> is performed as a last step when evaluating the domain path of a <em>Log Statement</em>,
542 * taking <em>Scope Domains</em> and the optional parameter \p{domain} of the statement into
543 * account.<br>
544 *
545 * <b>Wildcards</b><br>
546 * Parameter \p{domainPath} supports \b 'wildcard' character <c> '*'</c> at its beginning
547 * and at its end (or both). This allows to have four types of rules:
548 * - Exact match
549 * - Prefix match (\c * at the end of \p{domainPath})
550 * - Suffix match (\c * at the start of \p{domainPath})
551 * - Sub-string match (\c * at both, start and the end of \p{domainPath})
552 *
553 * Only minimal checks are performed, e.g. if an exact match is requested, but \p{domainPath}
554 * does not start with character <c> '/'</c>. In this and some other cases, the rule is not
555 * stored and an internal warning is logged. Further checks, for example for illegal
556 * domain path characters are not performed (those will be eliminated when the resulting
557 * domain path is to be created internally).
558 *
559 * <b>Circular Dependencies</b><br>
560 * If the given rules have circular dependencies, only a limited number (ten) replacements
561 * are performed. If this number of replacements for one <em>Log Statement</em> is exceeded, an internal
562 * warning message is logged. This is done only \e once over the life-time of a \e Logger.
563 *
564 * <b>Application of Rules</b><br>
565 * Rules are applied in the order of their definition. After all rules have been applied
566 * this is repeated as long as at least one rule matched (up to ten times).
567 *
568 * <b>Deletion of Rules</b>
569 * To delete a rule, invoke the method with same parameter \p{domainPath} and a \e 'nulled'
570 * or empty string for parameter \p{replacement}.
571 * To delete all rules, invoke the method with parameter \p{domainPath} \e 'nulled'
572 * or empty.
573 *
574 * <b>Final remarks</b>
575 * Domain substitution is useful to permanently change ('redirect') domain paths of
576 * 3rd party code (e.g. libraries using \alox) or log statements that must not be changed
577 * for other reasons. It is advised to not 'overuse' this feature, as side effects
578 * are inherent to the concept of <em>Domain Substitution</em>. For example, an unwanted
579 * side effect might be that <em>Prefix Logables</em> are not applicable to the substituted
580 * domain, while other <em>Prefix Logables</em> are bound to the resulting domain.
581 *
582 * For \b %Lox objects that should be protected of external manipulation, it is advisable,
583 * to remove all <em>Domain Substitution Rules</em> right after the \b %Lox was created by
584 * invoking this method with a \e nulled value for parameter \p{domainPath}.
585 * The reason is, that otherwise, through configuration files or command line parameters,
586 * domains of the \b %Lox can be substituted and then the resulting domains \e Verbosities
587 * be \e overwritten using further configuration variables.
588 * Any prioritized \e 'internal' setting of \e Verbosities this way could be circumvented!
589 *
590 * For more information consult the chapter \ref alib_mod_domain_substitution of the
591 * Programmer's Manual.
592 *
593 * @param domainPath The path to search. Has to start with either <c> '/'</c> or <c> '*'</c>.
594 * @param replacement The replacement path.
595 ******************************************************************************************/
596 void SetDomainSubstitutionRule( const NString& domainPath, const NString& replacement )
597 {
598 detail::LI::SetDomainSubstitutionRule(impl, domainPath, replacement);
599 }
600
601 /** ****************************************************************************************
602 * This method is used to remove an <em>explicitly given</em> domain path from the list
603 * of domain paths set for \e %Scope::ThreadOuter or \e %Scope::ThreadInner.
604 *
605 * To remove the most recently added domain path from such thread-related \e %Scope,
606 * use one of the overloaded methods #SetDomain and provide an empty or \e nulled
607 * value for parameter \p{scopeDomain} (the same as how domain paths of other \e %Scopes
608 * are removed).
609 *
610 * \note
611 * The long name of the method already indicates that this method is a little special.
612 * Only seldom, more than one <em>%Scope Domain</em> is needed to be added. And if this
613 * is needed, then such <em>%Scope Domains</em> usually get removed in reverse order of
614 * their definition, with is performed using the standard interface that allows 'removing'
615 * any other <em>%Scope Domain</em>. (Passing an empty or \e nulled domain
616 * path to method #SetDomain.)
617 *
618 * @param scopeDomain The domain path to register.
619 * @param scope Either \e %Scope::ThreadOuter or \e %Scope::ThreadInner. With other
620 * values, an internal error is logged.
621 * @param thread The thread to set/unset a thread-related Scope Domains for.
622 * Defaults to the current thread.
623 ******************************************************************************************/
624 void RemoveThreadDomain( const NString& scopeDomain, Scope scope,
625 threads::Thread* thread= nullptr )
626 {
627 detail::LI::RemoveThreadDomain(impl, scopeDomain, scope, thread);
628 }
629
630 /** ****************************************************************************************
631 * The given \p{prefix} becomes a <em>Prefix Logable</em> provided to loggers with each log
632 * statement executed within the given \p{scope}.
633 * The list of objects received by a logger is sorted from outer scope to inner scope.
634 * The logable of the <em>%Log Statement</em> itself, is the last in the list, except one or
635 * more <em>Prefix Logables</em> of \e %Scope::ThreadInner are set. Those are (similar to how
636 * this \e %Scope is used with <em>%Scope Domains</em>) appended to the end of the
637 * list.
638 *
639 * To remove a previously set <em>Prefix Logable</em>, \c nullptr has to be passed with
640 * parameter \p{prefix}.
641 * For \e %Scope::ThreadOuter and \e %Scope::ThreadInner, passing \c nullptr (respectively
642 * with the overloaded method accepting string messages, a \e nulled string)
643 * removes the most recently added <em>Prefix Logable</em>.
644 *
645 *
646 * \note
647 * \e Logables of boxed character array types are duplicated internally by \alox when
648 * setting as <em>Prefix Logables</em>.
649 * This means, in contrast to other types, for string-type <em>Prefix Logables</em>
650 * the life-cycle of the object passed in parameter \p{prefix} is allowed to end
651 * right after the invocation of this method. This is a convenience feature of \alox.
652 * However, this also means, that changes of the strings that occur after the string
653 * objects got set as a <em>Prefix Logable</em>, are \b not reflected.<br>
654 * To implement a "variable" <em>Prefix Logable</em> of string-type, an object of type
655 * \b %AString might be passed wrapped in class \c std::reference_wrapper<AString>.<br>
656 * For more information consult manual chapter
657 * \ref alib_mod_prefix_logables_lifecycle
658 * as well as chapter \ref alib_boxing_customizing_identity of the Programmer's Manual
659 * of module \alib_boxing.
660 *<p>
661 * \note
662 * Unlike other methods of this class which accept an arbitrary amount of logables, this
663 * method and its overloaded variants accept only one logable (the prefix).
664 * To supply several objects to be prefix logables at once, a container of type
665 * \ref alib::boxing::Boxes "Boxes" may be passed with parameter \p{logables}, like
666 * in the following sample:
667 * \snippet "ut_alox_log_scopes.cpp" DOX_ALOX_LOX_SETPREFIX
668 * The provided container as well as the prefixes themselves have to be kept in memory
669 * until they are unset.
670 *
671 *<p>
672 * \note
673 * The C++ version of \alox implements scope mechanisms using scope information
674 * generated by the preprocessor. By default, debug logging supports such caller
675 * information, release logging does not. Both defaults can be changed with preprocessor
676 * symbols \ref ALOX_DBG_LOG_CI and \ref ALOX_REL_LOG_CI.
677 *
678 *<p>
679 * \note
680 * The word 'prefix' in this method's name and in the name of \alox feature
681 * <em>Prefix Logables</em> is chosen for the fact that with text loggers (which is the
682 * most widely applied use case for \alox) such objects are prefixes to the log
683 * message. Of-course, with using \e %Scope::ThreadInner, this turns into a suffix!<br>
684 * When using \alox to process arbitrary objects instead of text messages, the concept of
685 * <em>Prefix Logables</em> is still very useful. Just the name does not fit so well anymore.
686 * Think of 'SetContext' and <em>Context Objects</em> instead.
687 *
688 * @param prefix The <em>Prefix Logable</em> to set.
689 * @param scope The scope that should the given \p{domain} be registered for.
690 * Available Scope definitions are platform/language dependent.
691 ******************************************************************************************/
692 void SetPrefix( const Box& prefix, Scope scope )
693 {
694 detail::LI::setPrefix( impl, prefix, scope, nullptr );
695 }
696
697 /** ****************************************************************************************
698 * This overloaded version of
699 * \ref SetPrefix(const Box&,Scope) "SetPrefix" is applicable only for
700 * \b %Scope::ThreadOuter and \b %Scope::ThreadInner and allows to specify the thread that
701 * the setting should be associated with.
702 *
703 * If \p{scopeDomain} is nullptr or empty, the most recently added <em>Prefix Logable</em>
704 * is removed.
705 *
706 * @param prefix The <em>Prefix Logable</em> to set.
707 * @param scope Either \e %Scope::ThreadOuter or \e %Scope::ThreadInner. With other
708 * values, an internal error is logged.
709 * @param thread The thread to set/unset a thread-related Scope Domains for.
710 ******************************************************************************************/
711 void SetPrefix( const Box& prefix, Scope scope, threads::Thread* thread )
712 {
713 detail::LI::setPrefix( impl, prefix, scope, thread );
714 }
715
716 /** ****************************************************************************************
717 * The given \p{prefix} becomes a <em>Prefix Logable</em> associated to the given
718 * <em>Log Domain</em>.
719 * <em>Prefix Logables</em> associated with the <em>Log Domain</em> are added to the
720 * list of \e Logables right
721 * before the main \e Logable of the <em>Log Statement</em> itself.
722 * Multiple <em>Prefix Logables</em> can be added per <em>Log Domain</em>.
723 *
724 * To remove the most recently added <em>Prefix Logable</em> associated with a <em>Log Domain</em>,
725 * \c nullptr has to be passed with parameter \p{prefix}.
726 *
727 * \note
728 * String-type \e Logables are duplicated internally by \alox when setting as
729 * <em>Prefix Logables</em>.
730 * This means, different to <em>Prefix Logables</em> of type \b %AString or custom types,
731 * the life-cycle of the object passed in parameter \p{prefix} is allowed to end
732 * right after the invocation of this method. For more information consult manual chapter
733 * \ref alib_mod_prefix_logables_lifecycle as well as chapter
734 * \ref alib_boxing_customizing_identity of the Programmer's Manual of module
735 * \alib_boxing.
736 *
737 * \attention
738 * The same as with most interface methods of this class, the given \p{domain} parameter
739 * is combined with <em>%Scope Domains</em> set for the caller's \e %Scope.
740 * To suppress this, an absolute domain path can be used. (Still any <em>Scope Domain</em>
741 * of \e %Scope::Thread::Inner will be applied).
742 * The default value of parameter \p{domain} is \c "" which addresses the domain evaluated
743 * for the current scope.
744 *
745 * @param prefix The <em>Prefix Logable</em> to set.
746 * @param domain The domain path. Defaults to \c nullptr, resulting in
747 * evaluated <em>Scope Domain</em> path.
748 * @param otherPLs If set to \c Inclusion::Exclude, scope-related
749 * <em>Prefix Logables</em> are ignored and only domain-related
750 * <em>Prefix Logables</em> are passed to the \e Loggers.<br>
751 * Defaults to \c Inclusion::Include.
752 ******************************************************************************************/
753 void SetPrefix( const Box& prefix, const NString& domain= nullptr,
755 {
756 detail::LI::SetPrefix(impl, prefix, domain, otherPLs);
757 }
758
759 /** ****************************************************************************************
760 * This method is used reset (or to explicitly set) the start time of one or all logger(s).
761 * The only impact is the output of time differences in the log lines. Hence, this method
762 * is useful to reset them and see some absolute time values when doing basic performance
763 * tests using the \e Logger.
764 *
765 * \note This affects loggers that are registered for at least one standard domain.
766 * In other words, loggers that are exclusively attached to the internal domain,
767 * will not be affected.
768 *
769 * @param startTime Optional parameter with the new start time. Defaults
770 * to current time if omitted.
771 * @param loggerName The name of the \e Logger(s) whose start time is to be set
772 * (case insensitive).
773 * Defaults to nullptr, which indicates that all loggers are to
774 * be affected.
775 ******************************************************************************************/
776 void SetStartTime( Ticks startTime = time::Ticks (),
777 const NString& loggerName = nullptr )
778 {
779 detail::LI::SetStartTime(impl, startTime, loggerName);
780 }
781
782 #if defined (__GLIBCXX__) || defined(__APPLE__)
783 /** ************************************************************************************
784 * Converts the given \p{startTime} and invokes #SetStartTime(Ticks,const NString&).
785 * \note GLib specific.
786 *
787 * @param startTime The new start time in system specific time unit.
788 * @param loggerName The name of the \e Logger whose start time is to be set (case
789 * insensitive).
790 * Defaults to empty string, which indicates that all loggers are to
791 * be affected.
792 **************************************************************************************/
793 void SetStartTime( time_t startTime, const NString& loggerName= nullptr )
794 {
795 detail::LI::SetStartTime(impl, startTime, loggerName);
796 }
797
798
799 #endif // no elif here, otherwise doxygen would ignore it!
800
801 #if defined( _MSC_VER )
802 /** ************************************************************************************
803 * Converts the given \p{startTime} and invokes#SetStartTime(Ticks,const NString&).
804 * \note Microsoft Windows specific.
805 *
806 * @param startTime The new start time in system specific time unit.
807 * @param loggerName The name of the \e Logger whose start time is to be set (case
808 * insensitive).
809 * Defaults to empty string, which indicates that all loggers are to
810 * be affected.
811 **************************************************************************************/
812 void SetStartTime( const FILETIME& startTime, const NString& loggerName= nullptr )
813 {
814 detail::LI::SetStartTime(impl, startTime, loggerName);
815 }
816
817 #endif
818
819 /** ****************************************************************************************
820 * This method sets a human readable name to the given thread ID (or current thread) which
821 * is optionally included in each log line.
822 *
823 * @param threadName The name of the thread as it should be displayed in the logs.
824 * @param id (Optional) Parameter providing the thread ID. If omitted, the
825 * current thread's ID is used.<br>
826 * If given, the associated object of \alib{threads;Thread} must not
827 * be deleted until this method returns. This is a race condition
828 * that a using code has do assure.
829 ******************************************************************************************/
830 void MapThreadName( const String& threadName, threads::ThreadID id= 0 )
831 {
832 detail::LI::MapThreadName(impl, threadName, id);
833 }
834
835 /** ****************************************************************************************
836 * Stores data encapsulated in an object of class
837 * \ref alib::boxing::Box "Box" which can be retrieved back by invoking
838 * #Retrieve. Using the optional \p{key} and \p{scope} offer various possibilities to
839 * reference this data later.
840 *
841 * To remove data from the store, pass \c nullptr with parameter \p{data}.
842 *
843 * \attention
844 * When data objects are 'overwritten', previous objects will be deleted internally.
845 * Hence, only pointers to heap-allocated objects (created with \c new) may be passed!<br>
846 * For more information, consult chapter \ref alib_mod_log_data of the
847 * Programmer's Manual.
848 *
849 * \note <em>Log Data</em> is a feature provided by \alox to support debug-logging.
850 * It is not advised to use <em>Log Data</em> to implement application logic.
851 *
852 * @param data The data object to store.
853 * If \c nullptr, currently stored data will be removed.
854 * In C++, has to be heap allocated and will be deleted
855 * by this \b %Lox when overwritten or this lox is deleted.
856 * @param key The optional key to the data.
857 * If omitted (or empty or nullptr), the data is bound to the \e %Scope
858 * provided. If omitted and \p{scope} is Scope::Global, then the
859 * data is unique to the \e Lox.
860 * @param scope The \e %Scope that the data is bound to.
861 ******************************************************************************************/
862 void Store( const Box& data, const NString& key, Scope scope= Scope::Global )
863 {
864 detail::LI::store( impl, data, key, scope );
865 }
866
867 /** ****************************************************************************************
868 * Overloaded version of
869 * Store(const Box&,const String&,Scope,int) "Store" which omits parameter \p{key}.
870 * @param data The data object to store.
871 * In C++, has to be heap allocated and will be deleted
872 * by this \b %Lox when overwritten or this lox is deleted.
873 * @param scope The \e %Scope that the data is bound to.
874 ******************************************************************************************/
875 void Store( const Box& data, Scope scope= Scope::Global )
876 {
877 detail::LI::store( impl, data, nullptr, scope );
878 }
879
880 /** ****************************************************************************************
881 * Retrieves \alox <em>Log Data</em>, an object type
882 * \ref alib::boxing::Box "Box" which had been stored in a prior call to
883 * #Store. Using the optional \p{key} and \p{scope} offer various possibilities to reference
884 * such objects.<br>
885 *
886 * \note If no data is found, an \e nulled object is returned. This can be tested using method
887 * \ref alib::boxing::Box::IsNull "Box::IsNull".
888 *
889 * <p>
890 * \note <em>Log Data</em> is a feature provided by \alox to support debug-logging.
891 * It is not advised to use <em>Log Data</em> to implement application logic.
892 *
893 * @param key The optional key to the data.
894 * If omitted (or empty or nullptr), the data is bound to the \e %Scope
895 * provided. If omitted and \p{scope} is Scope::Global, then the
896 * data is unique to the \e Lox.
897 * @param scope The \e %Scope that the data is bound to.
898 * @return The data, a \e nulled box if no value was found.
899 ******************************************************************************************/
901 Box Retrieve ( const NString& key, Scope scope= Scope::Global )
902 {
903 return detail::LI::retrieve( impl, key, scope );
904 }
905
906 /** ****************************************************************************************
907 * * Overloaded version of #Retrieve which omits parameter \p{key}.
908 *
909 * \note <em>Log Data</em> is a feature provided by \alox to support debug-logging.
910 * It is not advised to use <em>Log Data</em> to implement application logic.
911 *
912 * @param scope The \e %Scope that the data is bound to.
913 * @return The data, a \e nulled box if no value was found.
914 ******************************************************************************************/
916 Box Retrieve ( Scope scope= Scope::Global )
917 {
918 return detail::LI::retrieve( impl, nullptr, scope );
919 }
920
921 /** ****************************************************************************************
922 * This method logs the current configuration of this Lox and its encapsulated objects.
923 * It uses method #GetState to assemble the logable string.
924 *
925 * \note
926 * As an alternative to (temporarily) adding an invocation of <b>%Lox.State</b> to
927 * your code, \alox provides configuration variable\ref alxcvALOX_LOXNAME_DUMP_STATE_ON_EXIT.
928 * This allows to enable an automatic invocation of this method using external
929 * configuration data like command line parameters, environment variables or
930 * INI files.
931 *
932 * @param domain Optional <em>Log Domain</em> which is combined with <em>%Scope Domains</em>
933 * set for the \e %Scope of invocation.
934 * @param verbosity The verbosity.
935 * @param headLine If given, a separated headline will be logged at first place.
936 * @param flags Flag bits that define which state information is logged.
937 ******************************************************************************************/
938 void State ( const NString& domain,
939 Verbosity verbosity,
940 const String& headLine,
941 StateInfo flags = StateInfo::All )
942 {
943 detail::LI::State(impl, domain, verbosity, headLine, flags);
944 }
945
946 /** ****************************************************************************************
947 * This method collects state information about this lox in a formatted multi-line AString.
948 * Parameter \p{flags} is a bitwise enum type (operators on elements available).
949 *
950 * \note
951 * As an alternative to (temporarily) adding an invocation of <b>%Lox.State</b> to
952 * your code, \alox provides configuration variable \ref alxcvALOX_LOXNAME_DUMP_STATE_ON_EXIT.
953 * This allows to enable an automatic invocation of this method using external
954 * configuration data like command line parameters, environment variables or
955 * INI files.
956 * @param buf The target string.
957 * @param flags Bits that define which state information is collected.
958 ******************************************************************************************/
959 void GetState( NAString& buf, StateInfo flags= StateInfo::All )
960 {
961 detail::LI::GetState(impl, buf, flags);
962 }
963
964
965 // #############################################################################################
966 // Main logging methods
967 // #############################################################################################
968 /** ****************************************************************************************
969 * Returns a reference to a list of boxes to be used for logging. The list is recycled
970 * from a previous log operation and cleared. The method may be used to retrieve
971 * a container for logables that then are collected until finally logged.<br>
972 * Note that the \b %Lox instance has to be acquired prior to invoking this method and
973 * the container returned must be used only while the object is still acquired.
974 *
975 * With each recursive acquirement of this object, a different container is returned.
976 * This is implemented to allow recursive log calls.
977 *
978 * @return An empty list of boxes.
979 ******************************************************************************************/
984
985 /** ****************************************************************************************
986 * Logs the current list of \e Logables that previously have been received using
987 * #GetLogableContainer with the given \p{verbosity}.
988 *
989 * This method is usually \b not used directly. Instead, methods
990 * #Info, #Verbose, #Warning and #Error provide simpler interfaces which take variadic
991 * arguments that are collected in a list of boxed objects and then passed to
992 * this methods.<br>
993 * Note that the other interface methods accept an "external" list of boxes as a parameter.
994 * as well. This means also with these methods it is allowed to collect the logables in
995 * an user-specific list first and later pass them to these methods.
996 *
997 * Hence, the use of this method is recommended only if the verbosity of a log statement
998 * is evaluated only at run-time.
999 *
1000 * @param domain The domain.
1001 * @param verbosity The verbosity.
1002 ******************************************************************************************/
1003 void Entry( const NString& domain, Verbosity verbosity )
1004 {
1005 detail::LI::Entry(impl, domain, verbosity);
1006 }
1007
1008 /** ****************************************************************************************
1009 * Logs a list of \e Logables with the given \e %Verbosity.
1010 *
1011 * If more than one \e Logable is given and the first one is of string type and comprises a
1012 * valid domain path, then this first argument is interpreted as the domain name!
1013 * Valid domain path are strings that consists only of characters of the following set:
1014 * - upper case letters,
1015 * - numbers,
1016 * - hyphen (\c '-'),
1017 * - underscore (\c '_') and
1018 * - forward slash (\c '/').
1019 *
1020 * If a first \e Logable could be misinterpreted as being a domain name, an empty string
1021 * (the "neutral" domain) has to be added as a first argument. Alternatively, a character
1022 * which is illegal in respect to domain names could be added to the first argument,
1023 * for example a simple space at the end of an output string.
1024 *
1025 * \note
1026 * This method allows a consistent interface of overloaded methods \b %Info, \b Error,
1027 * etc, without introducing a separate version which excepts a - then mandatory - domain
1028 * parameter.
1029 * The little drawback of the auto detection is the possibility of ambiguous invocations.
1030 *
1031 * @param verbosity The verbosity.
1032 * @param logables The list of \e Logables, optionally including a domain name at the start.
1033 ******************************************************************************************/
1034 template <typename... BoxedObjects>
1035 void EntryDetectDomain( Verbosity verbosity, BoxedObjects&&... logables )
1036 {
1037 detail::LI::GetLogableContainer(impl).Add( std::forward<BoxedObjects>(logables)... );
1039 }
1040
1041 /** ****************************************************************************************
1042 * Logs given logables using \alib{lox;Verbosity;Verbosity::Verbose}.
1043 *
1044 * The first object provided may be a domain name. All values are passed to
1045 * #EntryDetectDomain. See documentation of this method for information on how to avoid
1046 * ambiguities in respect to domain names.
1047 *
1048 * If one of the arguments (or a single argument given) is of type
1049 * \ref alib::boxing::Boxes "Boxes", then the contents of this list is inserted into
1050 * the list of logables. This allows to collect logables prior to invoking the method.
1051 *
1052 * @param logables The list of \e Logables, optionally including a domain name at the start.
1053 ******************************************************************************************/
1054 template <typename... BoxedObjects>
1055 void Verbose( BoxedObjects&&... logables )
1056 {
1057 detail::LI::GetLogableContainer(impl).Add( std::forward<BoxedObjects>(logables)... );
1058 detail::LI::entryDetectDomainImpl( impl, Verbosity::Verbose );
1059 }
1060
1061 /** ****************************************************************************************
1062 * Logs given logables using \alib{lox;Verbosity;Verbosity::Info}.
1063 *
1064 * The first object provided may be a domain name. All values are passed to
1065 * #EntryDetectDomain. See documentation of this method for information on how to avoid
1066 * ambiguities in respect to domain names.
1067 *
1068 * If one of the arguments (or a single argument given) is of type
1069 * \ref alib::boxing::Boxes "Boxes", then the contents of this list is inserted into
1070 * the list of logables. This allows to collect logables prior to invoking the method.
1071 *
1072 * @param logables The list of \e Logables, optionally including a domain name at the start.
1073 ******************************************************************************************/
1074 template <typename... BoxedObjects>
1075 void Info( BoxedObjects&&... logables )
1076 {
1077 detail::LI::GetLogableContainer(impl).Add( std::forward<BoxedObjects>(logables)... );
1078 detail::LI::entryDetectDomainImpl( impl, Verbosity::Info );
1079 }
1080
1081 /** ****************************************************************************************
1082 * Logs given logables using \alib{lox;Verbosity;Verbosity::Warning}.
1083 *
1084 * The first object provided may be a domain name. All values are passed to
1085 * #EntryDetectDomain. See documentation of this method for information on how to avoid
1086 * ambiguities in respect to domain names.
1087 *
1088 * If one of the arguments (or a single argument given) is of type
1089 * \ref alib::boxing::Boxes "Boxes", then the contents of this list is inserted into
1090 * the list of logables. This allows to collect logables prior to invoking the method.
1091 *
1092 * @param logables The list of \e Logables, optionally including a domain name at the start.
1093 ******************************************************************************************/
1094 template <typename... BoxedObjects>
1095 void Warning( BoxedObjects&&... logables )
1096 {
1097 detail::LI::GetLogableContainer(impl).Add( std::forward<BoxedObjects>(logables)... );
1098 detail::LI::entryDetectDomainImpl( impl, Verbosity::Warning );
1099 }
1100
1101 /** ****************************************************************************************
1102 * Logs given logables using \alib{lox;Verbosity;Verbosity::Error}.
1103 *
1104 * The first object provided may be a domain name. All values are passed to
1105 * #EntryDetectDomain. See documentation of this method for information on how to avoid
1106 * ambiguities in respect to domain names.
1107 *
1108 * If one of the arguments (or a single argument given) is of type
1109 * \ref alib::boxing::Boxes "Boxes", then the contents of this list is inserted into
1110 * the list of logables. This allows to collect logables prior to invoking the method.
1111 *
1112 * @param logables The list of \e Logables, optionally including a domain name at the start.
1113 ******************************************************************************************/
1114 template <typename... BoxedObjects>
1115 void Error( BoxedObjects&&... logables )
1116 {
1117 detail::LI::GetLogableContainer(impl).Add( std::forward<BoxedObjects>(logables)... );
1118 detail::LI::entryDetectDomainImpl( impl, Verbosity::Error );
1119 }
1120
1121 /** ****************************************************************************************
1122 * Logs given logables only if the parameter \p{condition} is not \c true.
1123 * If executed, \alib{lox;Verbosity;Verbosity::Error} is used.
1124 *
1125 * The first object provided may be a domain name. All values are passed to
1126 * #EntryDetectDomain. See documentation of this method for information on how to avoid
1127 * ambiguities in respect to domain names.
1128 *
1129 * If one of the arguments (or a single argument given) is of type
1130 * \ref alib::boxing::Boxes "Boxes", then the contents of this list is inserted into
1131 * the list of logables. This allows to collect logables prior to invoking the method.
1132 *
1133 * @param condition If \c false, the <em>Log Statement</em> is executed.
1134 * @param logables The list of \e Logables, optionally including a domain name at the start.
1135 ******************************************************************************************/
1136 template <typename... BoxedObjects>
1137 void Assert( bool condition, BoxedObjects&&... logables )
1138 {
1139 if (!condition )
1140 {
1141 detail::LI::GetLogableContainer(impl).Add( std::forward<BoxedObjects>(logables)... );
1142 detail::LI::entryDetectDomainImpl( impl, Verbosity::Error );
1143 }
1144 else
1146 }
1147
1148 /** ****************************************************************************************
1149 * Logs a list of \e Logables only if the parameter \p{condition} is \c true.
1150 *
1151 * \see Method #Assert.
1152 *
1153 * @param condition If \c false, the <em>Log Statement</em> is executed.
1154 * @param domain Optional <em>Log Domain</em> which is combined with <em>%Scope Domains</em>
1155 * set for the \e %Scope of invocation.
1156 * @param verbosity The verbosity.
1157 * @param logables The list of \e Logables.
1158 ******************************************************************************************/
1159 template <typename... BoxedObjects>
1160 void If( bool condition, const NString& domain, Verbosity verbosity, BoxedObjects&&... logables )
1161 {
1162 if ( condition )
1163 {
1164 detail::LI::GetLogableContainer(impl).Add( std::forward<BoxedObjects>(logables)... );
1165 detail::LI::Entry( impl, domain, verbosity );
1166 }
1167 else
1169 }
1170
1171 /** ****************************************************************************************
1172 * Logs a list of \e Logables only if the parameter \p{condition} is \c true.<br>
1173 *
1174 * This overloaded version omits parameter \p{domain}.
1175 * The first \e logable provided may be a domain name. All values are passed to
1176 * #EntryDetectDomain. See documentation of this method for information on how to avoid
1177 * ambiguities in respect to domain names.
1178 *
1179 * If one of the arguments (or a single argument given) is of type
1180 * \ref alib::boxing::Boxes "Boxes", then the contents of this list is inserted into
1181 * the list of logables. This allows to collect logables prior to invoking the method.
1182 *
1183 * \see Method #Assert.
1184 *
1185 * @param condition If \c false, the <em>Log Statement</em> is executed.
1186 * @param verbosity The verbosity.
1187 * @param logables The list of \e Logables.
1188 ******************************************************************************************/
1189 template <typename... BoxedObjects>
1190 void If( bool condition, Verbosity verbosity, BoxedObjects&&... logables )
1191 {
1192 if ( condition )
1193 {
1194 detail::LI::GetLogableContainer(impl).Add( std::forward<BoxedObjects>(logables)... );
1196 }
1197 else
1199 }
1200
1201
1202 /** ****************************************************************************************
1203 * Logs given \e logables once, up to \p{quantity} times, or every n-th time.
1204 * In its simplest overloaded version, the counter is bound to the source code line, hence,
1205 * only the first execution of this exact <em>Log Statement</em> is executed.
1206 *
1207 * With parameter \p{group}, a set of <em>Log Statements</em> that share the same group key,
1208 * can be grouped and of such set, only the one which is first executed actually logs.<br>
1209 * Alternatively, when \p{key} is omitted (or nullptr or empty), but a
1210 * \ref alib::lox::Scope "Scope" is given with parameter \p{scope}, then the
1211 * counter is associated with the scope.<br>
1212 * Finally, parameters \p{key} and \p{scope} can also be used in combination. The key is
1213 * then unique in respect to the \ref alib::lox::Scope "Scope" provided.
1214 *
1215 * Using, none, one or both of the parameters \p{group} and \p{scope}, among others, the
1216 * following use cases can be achieved.
1217 * - %Log a specific statement up to n-times.
1218 * - %Log only the first n of a group of statements.
1219 * - %Log only the first n statements within a method.
1220 * - %Log only the first n statements belonging to the same group and method .
1221 * - %Log only the first n statements within any method of
1222 * - a source file
1223 * - a directory of source files
1224 * - a parent directory of source files and all sources recursively
1225 * - %Log only the first n statements which belong to the same group and are placed within
1226 * any method of
1227 * - a source file
1228 * - a directory of source files
1229 * - a parent directory of source files and all sources recursively
1230 * - %Log a <em>Log Statement</em> n-times per new thread.
1231 * - %Log only the first n statements of a group of statements executed by a specific thread.
1232 *
1233 * When parameter \p{quantity} is a negative value, the log statement is executed every n-th time
1234 * instead n-times. E.g, if \p{quantity} is \c -5, the first statement is executed and afterwards
1235 * every fifth invocation.
1236 *
1237 * \note
1238 * Unlike other methods of this class which accept an arbitrary amount of logables, this
1239 * method and its overloaded variants accept only one boxed object.
1240 * To still be able to supply several objects at once, an array of boxes or a container
1241 * of type \ref alib::boxing::Boxes "Boxes" may be passed with parameter
1242 * \p{logables}, like in the following sample:
1243 * \snippet "ut_alox_lox.cpp" DOX_ALOX_LOX_ONCE
1244 * This is why the parameter name \p{logables} still uses the plural with its name!
1245 *
1246 *
1247 * @param domain Optional <em>Log Domain</em> which is combined with <em>%Scope Domains</em>
1248 * set for the \e %Scope of invocation.
1249 * @param verbosity The verbosity of the <em>Log Statement</em> (if performed).
1250 * @param logables The objects to log (Multiple objects may be provided within
1251 * container class Boxes.)
1252 * @param group The optional name of the statement group . If used, all statements that
1253 * share the same group name are working on the same counter (according
1254 * to the \p{scope}.)
1255 * If omitted (or empty or nullptr), the counter is bound to the \e %Scope
1256 * provided. If omitted and \p{scope} is Scope::Global, then the
1257 * counter is associated exclusively with the single <em>Log Statement</em> itself.
1258 * @param scope The \e %Scope that the group or counter is bound to.
1259 * @param quantity The number of logs to be performed. As the name of the method indicates,
1260 * this defaults to \c 1.
1261 * If negative, the first and every "-quantity-th" statement is executed.
1262 ******************************************************************************************/
1263 void Once( const NString& domain , Verbosity verbosity,
1264 const Box& logables,
1265 const String& group,
1266 Scope scope= Scope::Global,
1267 int quantity= 1)
1268 {
1269 detail::LI::once( impl, domain, verbosity, logables, group, scope, quantity );
1270 }
1271
1272 /** ****************************************************************************************
1273 * Overloaded version of
1274 * \ref Once(const NString&,Verbosity,const Box&,const String&,Scope,int) "Once".
1275 *
1276 * @param verbosity The verbosity of the <em>Log Statement</em> (if performed).
1277 * @param logables The objects to log (Multiple objects may be provided within
1278 * container class Boxes.)
1279 * @param group The optional name of the statement group . If used, all statements that
1280 * share the same group name are working on the same counter (according
1281 * to the \p{scope}.)
1282 * If omitted (or empty or nullptr), the counter is bound to the \e %Scope
1283 * provided. If omitted and \p{scope} is Scope::Global, then the
1284 * counter is associated exclusively with the single <em>Log Statement</em> itself.
1285 * @param scope The \e %Scope that the group or counter is bound to.
1286 * @param quantity The number of logs to be performed. As the name of the method indicates,
1287 * this defaults to \c 1.
1288 ******************************************************************************************/
1289 void Once( Verbosity verbosity, const Box& logables,
1290 const String& group,
1291 Scope scope,
1292 int quantity= 1)
1293 {
1294 detail::LI::once( impl, nullptr, verbosity, logables, group, scope, quantity );
1295 }
1296
1297 /** ****************************************************************************************
1298 * Overloaded version of
1299 * \ref Once(const NString&,Verbosity,const Box&,const String&,Scope,int) "Once".
1300 *
1301 * @param verbosity The verbosity of the <em>Log Statement</em> (if performed).
1302 * @param logables The objects to log (Multiple objects may be provided within
1303 * container class Boxes.)
1304 * @param group The optional name of the statement group . If used, all statements that
1305 * share the same group name are working on the same counter (according
1306 * to the \p{scope}.)
1307 * If omitted (or empty or nullptr), the counter is bound to the \e %Scope
1308 * provided. If omitted and \p{scope} is Scope::Global, then the
1309 * counter is associated exclusively with the single <em>Log Statement</em> itself.
1310 * @param quantity The number of logs to be performed. As the name of the method indicates,
1311 * this defaults to \c 1.
1312 ******************************************************************************************/
1313 void Once( Verbosity verbosity, const Box& logables,
1314 const String& group,
1315 int quantity= 1)
1316 {
1317 detail::LI::once( impl, nullptr, verbosity, logables, group, Scope::Global, quantity );
1318 }
1319
1320 /** ****************************************************************************************
1321 * Overloaded version of
1322 * \ref Once(const NString&,Verbosity,const Box&,const String&,Scope,int) "Once".
1323 *
1324 * @param verbosity The verbosity of the <em>Log Statement</em> (if performed).
1325 * @param logables The objects to log (Multiple objects may be provided within
1326 * container class Boxes.)
1327 * @param quantity The number of logs to be performed. As the name of the method indicates,
1328 * this defaults to \c 1.
1329 ******************************************************************************************/
1330 void Once( Verbosity verbosity, const Box& logables,
1331 int quantity= 1)
1332 {
1333 detail::LI::once( impl, nullptr, verbosity, logables, nullptr, Scope::Global, quantity );
1334 }
1335
1336 /** ****************************************************************************************
1337 * Overloaded version of
1338 * \ref Once(const NString&,Verbosity,const Box&,const String&,Scope,int) "Once".
1339 *
1340 * @param logables The objects to log (Multiple objects may be provided within
1341 * container class Boxes.)
1342 * @param group The optional name of the statement group . If used, all statements that
1343 * share the same group name are working on the same counter (according
1344 * to the \p{scope}.)
1345 * If omitted (or empty or nullptr), the counter is bound to the \e %Scope
1346 * provided. If omitted and \p{scope} is Scope::Global, then the
1347 * counter is associated exclusively with the single <em>Log Statement</em> itself.
1348 * @param scope The \e %Scope that the group or counter is bound to.
1349 * @param quantity The number of logs to be performed. As the name of the method indicates,
1350 * this defaults to \c 1.
1351 ******************************************************************************************/
1352 void Once( const Box& logables,
1353 const String& group,
1354 Scope scope,
1355 int quantity= 1)
1356 {
1357 detail::LI::once( impl, nullptr, Verbosity::Info, logables, group, scope, quantity );
1358 }
1359
1360 /** ****************************************************************************************
1361 * Overloaded version of
1362 * \ref Once(const NString&,Verbosity,const Box&,const String&,Scope,int) "Once".
1363 *
1364 * @param domain Optional <em>Log Domain</em> which is combined with <em>%Scope Domains</em>
1365 * set for the \e %Scope of invocation.
1366 * @param verbosity The verbosity of the <em>Log Statement</em> (if performed).
1367 * @param logables The objects to log (Multiple objects may be provided within
1368 * container class Boxes.)
1369 * @param scope The \e %Scope that the group or counter is bound to.
1370 * @param quantity The number of logs to be performed. As the name of the method indicates,
1371 * this defaults to \c 1.
1372 ******************************************************************************************/
1373 void Once( const NString& domain, Verbosity verbosity, const Box& logables,
1374 Scope scope= Scope::Global ,
1375 int quantity= 1)
1376 {
1377 detail::LI::once( impl, domain, verbosity, logables, nullptr, scope, quantity );
1378 }
1379
1380 /** ****************************************************************************************
1381 * Overloaded version of
1382 * \ref Once(const NString&,Verbosity,const Box&,const String&,Scope,int) "Once".
1383 *
1384 * @param verbosity The verbosity of the <em>Log Statement</em> (if performed).
1385 * @param logables The objects to log (Multiple objects may be provided within
1386 * container class Boxes.)
1387 * @param scope The \e %Scope that the group or counter is bound to.
1388 * @param quantity The number of logs to be performed. As the name of the method indicates,
1389 * this defaults to \c 1.
1390 ******************************************************************************************/
1391 void Once( Verbosity verbosity, const Box& logables,
1392 Scope scope,
1393 int quantity= 1)
1394 {
1395 detail::LI::once( impl, nullptr, verbosity, logables, nullptr, scope, quantity );
1396 }
1397
1398 /** ****************************************************************************************
1399 * Overloaded version of
1400 * \ref Once(const NString&,Verbosity,const Box&,const String&,Scope,int) "Once".
1401 *
1402 * @param logables The objects to log (Multiple objects may be provided within
1403 * container class Boxes.)
1404 * @param scope The \e %Scope that the group or counter is bound to.
1405 * @param quantity The number of logs to be performed. As the name of the method indicates,
1406 * this defaults to \c 1.
1407 ******************************************************************************************/
1408 void Once( const Box& logables,
1409 Scope scope,
1410 int quantity= 1)
1411 {
1412 detail::LI::once( impl, nullptr, Verbosity::Info, logables, nullptr, scope, quantity );
1413 }
1414
1415 /** ****************************************************************************************
1416 * Overloaded version of
1417 * \ref Once(const NString&,Verbosity,const Box&,const String&,Scope,int) "Once".
1418 *
1419 * @param logables The objects to log (Multiple objects may be provided within
1420 * container class Boxes.)
1421 * @param quantity The number of logs to be performed. As the name of the method indicates,
1422 * this defaults to \c 1.
1423 ******************************************************************************************/
1424 void Once( const Box& logables,
1425 int quantity= 1)
1426 {
1427 detail::LI::once( impl, nullptr, Verbosity::Info, logables, nullptr, Scope::Global, quantity );
1428 }
1429
1430 /** ****************************************************************************************
1431 * Overloaded version of
1432 * \ref Once(const NString&,Verbosity,const Box&,const String&,Scope,int) "Once".
1433 *
1434 * @param logables The objects to log (Multiple objects may be provided within
1435 * container class Boxes.)
1436 * @param group The optional name of the statement group . If used, all statements that
1437 * share the same group name are working on the same counter (according
1438 * to the \p{scope}.)
1439 * If omitted (or empty or nullptr), the counter is bound to the \e %Scope
1440 * provided. If omitted and \p{scope} is Scope::Global, then the
1441 * counter is associated exclusively with the single <em>Log Statement</em> itself.
1442 * @param quantity The number of logs to be performed. As the name of the method indicates,
1443 * this defaults to \c 1.
1444 ******************************************************************************************/
1445 void Once( const Box& logables,
1446 const String& group, int quantity= 1 )
1447 {
1448 detail::LI::once( impl, nullptr, Verbosity::Info, logables, group, Scope::Global, quantity );
1449 }
1450
1451 /** ****************************************************************************************
1452 * Returns the number of loggers attached, which are active in respect to the given
1453 * combination of verbosity and log domain.
1454 *
1455 * This method may be used to avoid the execution of more complex logging code when such
1456 * logging would not result in log activity due to the current log level settings.
1457 *
1458 * @param verbosity The verbosity to query for activity.
1459 * @param domain The log domain. All rules for resolving the effective log domain
1460 * apply as with normal log statements.<br>
1461 * Defaults to \b NullNString.
1462 * @return The number of active loggers.
1463 ******************************************************************************************/
1464 int IsActive( Verbosity verbosity, const NString& domain= NullNString() )
1465 {
1466 return detail::LI::IsActive( impl, verbosity, domain );
1467 }
1468
1469 // #############################################################################################
1470 // Debug methods
1471 // #############################################################################################
1472 #if ALIB_DEBUG_MONOMEM
1473 /** ****************************************************************************************
1474 * Returns the internal \b MonoAllocator used for storing permanent data.
1475 *
1476 * \par Availability
1477 * This method is available only with debug builds with \ref ALIB_DEBUG_MONOMEM set.
1478 *
1479 * @return The monotonic allocator of this \b Lox.
1480 ******************************************************************************************/
1485 #endif
1486
1487}; // class Lox
1488
1489} // namespace alib[::lox]
1490
1491/// Type alias in namespace \b alib.
1493
1494} // namespace [alib]
1495
1497
1498#endif // HPP_ALOX_LOX
ALIB_API Box Retrieve(Scope scope=Scope::Global)
Definition lox.inl:916
void Error(BoxedObjects &&... logables)
Definition lox.inl:1115
void SetStartTime(const FILETIME &startTime, const NString &loggerName=nullptr)
Definition lox.inl:812
void Info(BoxedObjects &&... logables)
Definition lox.inl:1075
void Once(const Box &logables, Scope scope, int quantity=1)
Definition lox.inl:1408
void Once(const Box &logables, int quantity=1)
Definition lox.inl:1424
bool RemoveLogger(detail::Logger *logger)
Definition lox.inl:375
detail::LoxImpl * impl
Definition lox.inl:93
void Store(const Box &data, Scope scope=Scope::Global)
Definition lox.inl:875
void If(bool condition, Verbosity verbosity, BoxedObjects &&... logables)
Definition lox.inl:1190
detail::Logger * RemoveLogger(const NString &loggerName)
Definition lox.inl:390
static ALIB_API detail::textlogger::TextLogger * CreateConsoleLogger(const NString &name=nullptr)
void Entry(const NString &domain, Verbosity verbosity)
Definition lox.inl:1003
void SetPrefix(const Box &prefix, Scope scope, threads::Thread *thread)
Definition lox.inl:711
monomem::MonoAllocator & DbgGetMonoAllocator()
Definition lox.inl:1481
void Once(Verbosity verbosity, const Box &logables, const String &group, int quantity=1)
Definition lox.inl:1313
void Once(const Box &logables, const String &group, int quantity=1)
Definition lox.inl:1445
void If(bool condition, const NString &domain, Verbosity verbosity, BoxedObjects &&... logables)
Definition lox.inl:1160
void Once(const NString &domain, Verbosity verbosity, const Box &logables, const String &group, Scope scope=Scope::Global, int quantity=1)
Definition lox.inl:1263
Lox(const NString &name, bool doRegister=true)
Definition lox.inl:147
void State(const NString &domain, Verbosity verbosity, const String &headLine, StateInfo flags=StateInfo::All)
Definition lox.inl:938
void Once(Verbosity verbosity, const Box &logables, const String &group, Scope scope, int quantity=1)
Definition lox.inl:1289
static constexpr NString InternalDomains
Definition lox.inl:121
void SetStartTime(time_t startTime, const NString &loggerName=nullptr)
Definition lox.inl:793
void RemoveThreadDomain(const NString &scopeDomain, Scope scope, threads::Thread *thread=nullptr)
Definition lox.inl:624
void Store(const Box &data, const NString &key, Scope scope=Scope::Global)
Definition lox.inl:862
void Verbose(BoxedObjects &&... logables)
Definition lox.inl:1055
int IsActive(Verbosity verbosity, const NString &domain=NullNString())
Definition lox.inl:1464
void SetDomainSubstitutionRule(const NString &domainPath, const NString &replacement)
Definition lox.inl:596
void Reset(bool reInitialze=true)
Definition lox.inl:234
void SetPrefix(const Box &prefix, const NString &domain=nullptr, lang::Inclusion otherPLs=lang::Inclusion::Include)
Definition lox.inl:753
integer & GetLogCounter()
Definition lox.inl:186
void SetPrefix(const Box &prefix, Scope scope)
Definition lox.inl:692
void EntryDetectDomain(Verbosity verbosity, BoxedObjects &&... logables)
Definition lox.inl:1035
void MapThreadName(const String &threadName, threads::ThreadID id=0)
Definition lox.inl:830
void Release()
Definition lox.inl:210
void SetDomain(const NString &scopeDomain, Scope scope)
Definition lox.inl:514
void Assert(bool condition, BoxedObjects &&... logables)
Definition lox.inl:1137
void Once(Verbosity verbosity, const Box &logables, int quantity=1)
Definition lox.inl:1330
void Warning(BoxedObjects &&... logables)
Definition lox.inl:1095
Boxes & GetLogableContainer()
Definition lox.inl:980
void Once(const Box &logables, const String &group, Scope scope, int quantity=1)
Definition lox.inl:1352
ALIB_API Box Retrieve(const NString &key, Scope scope=Scope::Global)
Definition lox.inl:901
void Acquire(const NCString &file, int line, const NCString &func)
Definition lox.inl:201
const NString & GetName()
Definition lox.inl:170
void Once(const NString &domain, Verbosity verbosity, const Box &logables, Scope scope=Scope::Global, int quantity=1)
Definition lox.inl:1373
void SetSourcePathTrimRule(const NCString &path, lang::Inclusion includeString=lang::Inclusion::Exclude, int trimOffset=0, lang::Case sensitivity=lang::Case::Ignore, const NString &trimReplacement=NullNString(), lang::Reach reach=lang::Reach::Global, Priorities priority=Priorities::DefaultValues)
Definition lox.inl:295
detail::Logger * GetLogger(const NString &loggerName)
Definition lox.inl:360
void SetStartTime(Ticks startTime=time::Ticks(), const NString &loggerName=nullptr)
Definition lox.inl:776
void ClearSourcePathTrimRules(lang::Reach reach=lang::Reach::Global, bool allowAutoRule=true)
Definition lox.inl:324
void SetVerbosity(detail::Logger *logger, Verbosity verbosity, const NString &domain="/", Priorities priority=Priorities::DefaultValues)
Definition lox.inl:454
void GetState(NAString &buf, StateInfo flags=StateInfo::All)
Definition lox.inl:959
void Once(Verbosity verbosity, const Box &logables, Scope scope, int quantity=1)
Definition lox.inl:1391
void SetVerbosity(const NString &loggerName, Verbosity verbosity, const NString &domain="/", Priorities priority=Priorities::DefaultValues)
Definition lox.inl:477
void SetDomain(const NString &scopeDomain, Scope scope, threads::Thread *thread)
Definition lox.inl:534
#define ALIB_ENUMS_MAKE_BITWISE(TEnum)
Definition bitwise.hpp:120
#define ALIB_ENUMS_ASSIGN_RECORD(TEnum, TRecord)
Definition records.hpp:752
#define ALIB_API
Definition alib.hpp:538
@ Exclude
Chooses exclusion.
@ Include
Chooses inclusion.
@ Global
Denotes global reach.
StateInfo
Definition lox.inl:40
@ 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.
@ Once
Log once counters.
@ ThreadMappings
Named threads.
integer ThreadID
Definition loxpimpl.inl:34
Definition alib.cpp:57
lox::detail::textlogger::TextLogger TextLogger
Type alias in namespace alib.
constexpr NString NullNString()
Definition string.hpp:2510
lox::detail::Logger Logger
Type alias in namespace alib.
Definition logger.hpp:199
lang::integer integer
Type alias in namespace alib.
Definition integers.hpp:286
static ALIB_API void SetSourcePathTrimRule(LoxImpl *impl, const NCString &path, lang::Inclusion includeString, int trimOffset, lang::Case sensitivity, const NString &trimReplacement, lang::Reach reach, Priorities priority)
Definition loxpimpl.cpp:555
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 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)
Definition loxpimpl.cpp:988
static ALIB_API detail::Logger * GetLogger(LoxImpl *impl, const NString &loggerName)
Definition loxpimpl.cpp:579
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)
Definition loxpimpl.cpp:782
static ALIB_API void store(LoxImpl *impl, const Box &data, const NString &pKey, Scope scope)
static ALIB_API void Release(LoxImpl *impl)
Definition loxpimpl.cpp:322
static ALIB_API void IncreaseLogCounter(LoxImpl *impl)
static ALIB_API void Construct(Lox *lox, const NString &name, bool doRegister)
Definition loxpimpl.cpp:269
static ALIB_API void Reset(LoxImpl *impl, bool reInitialze=true)
Definition loxpimpl.cpp:379
static ALIB_API Boxes & GetLogableContainer(LoxImpl *impl)
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)
Definition loxpimpl.cpp:282
static ALIB_API Box retrieve(LoxImpl *impl, const NString &pKey, Scope scope)
static ALIB_API integer & GetLogCounter(LoxImpl *impl)
Definition loxpimpl.cpp:296
static ALIB_API const NString & GetName(LoxImpl *impl)
Definition loxpimpl.cpp:291
static ALIB_API void Entry(LoxImpl *impl, const NString &domain, Verbosity verbosity)
static ALIB_API monomem::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 void Acquire(LoxImpl *impl, const NCString &file, int line, const NCString &func)
Definition loxpimpl.cpp:309
static ALIB_API void SetPrefix(LoxImpl *impl, const Box &prefix, const NString &domain, lang::Inclusion otherPLs)
static ALIB_API void SetVerbosity(LoxImpl *impl, detail::Logger *logger, Verbosity verbosity, const NString &domain, Priorities priority)
Definition loxpimpl.cpp:849
static ALIB_API int IsActive(LoxImpl *impl, Verbosity verbosity, const NString &domain)