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