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