ALib C++ Library
Library Version: 2402 R1
Documentation generated by doxygen
Loading...
Searching...
No Matches
loxpimpl.inl
Go to the documentation of this file.
1/** ************************************************************************************************
2 * \file
3 * This header file is part of module \alib_alox of the \aliblong.
4 *
5 * \emoji :copyright: 2013-2024 A-Worx GmbH, Germany.
6 * Published under \ref mainpage_license "Boost Software License".
7 **************************************************************************************************/
8#ifndef HPP_ALOX_DETAIL_LOXPIMPL
9#define HPP_ALOX_DETAIL_LOXPIMPL 1
10
11#if !defined(HPP_ALOX_LOX)
12# error "ALib sources with ending '.inl' must not be included from outside."
13#endif
14
15// #################################################################################################
16// includes
17// #################################################################################################
18#if !defined (HPP_ALIB_MONOMEM_MONOMEM)
20#endif
21
22
23#if !defined (HPP_ALIB_TIME_TICKS)
24 #include "alib/time/ticks.hpp"
25#endif
26
27// forwards
28namespace alib {
29
30namespace threads
31{
32 class Thread;
33 class ThreadLock;
35}
36
37namespace lox { namespace detail {
38 class Domain;
39 class Logger;
40 namespace textlogger
41 {
42 class TextLogger;
43 }
44}
45
46}} // namespace [alib::lox]
47
48
49namespace alib { namespace lox { namespace detail {
50
51struct LoxImpl;
52
53/** ************************************************************************************************
54 * Struct that collects static functions that provide the implementation of methods of
55 * class \alib{lox;Lox}. For most; the first parameter is of type \p{lox;detail::LoxImpl}.
56 **************************************************************************************************/
57struct LI
58{
59 /** ********************************************************************************************
60 * Implementation of the constructor \alib{lox;Lox::Lox;the constructor} of class \b %Lox.
61 *
62 * @param lox The \b %Lox that is to be constructed.
63 * @param name The name of the Lox. Will be copied and converted to upper case.
64 * @param doRegister If \c true, this object is registered with static class
65 * \ref alib::lox::ALox "ALox".
66 **********************************************************************************************/
67 ALIB_API static
68 void Construct( Lox* lox, const NString& name, bool doRegister );
69
70 /** ********************************************************************************************
71 * Destructs a lox.
72 * @param lox The \b %Lox that is to be destructed.
73 **********************************************************************************************/
74 ALIB_API static
75 void Destruct( Lox* lox );
76
77 /** ********************************************************************************************
78 * Implementation of method \alib{lox;Lox::GetName}.
79 *
80 * @param impl The implementation struct of the \b Lox.
81 * @returns The name of this %Lox.
82 **********************************************************************************************/
83 ALIB_API static
84 const NString& GetName(LoxImpl* impl);
85
86 /** ********************************************************************************************
87 * Implementation of method \alib{lox;Lox::GetLogCounter}.
88 *
89 * @param impl The implementation struct of the \b Lox.
90 * @returns The name of this %Lox.
91 **********************************************************************************************/
92 ALIB_API static
94
95 /** ********************************************************************************************
96 * Implementation of method \alib{lox;Lox::Acquire}.
97 *
98 * @param impl The implementation struct of the \b Lox.
99 * @param file The name of the source code file that the call is placed in.
100 * Usually the predefined preprocessor macro __FILE__ is passed here.
101 * @param line The line number within the source code file that the call is placed in.
102 * Usually the predefined preprocessor macro __LINE__ is passed here.
103 * @param func The name of the function that the call is placed in.
104 * Usually the predefined preprocessor macro __func__ (or __FUNCTION__) is
105 * passed here.
106 **********************************************************************************************/
107 ALIB_API static
108 void Acquire(LoxImpl* impl, const NCString& file, int line, const NCString& func );
109
110 /** ********************************************************************************************
111 * Implementation of method \alib{lox;Lox::Release}.
112 * @param impl The implementation struct of the \b Lox.
113 **********************************************************************************************/
114 ALIB_API static
115 void Release(LoxImpl* impl);
116
117 /** ********************************************************************************************
118 * Implementation of method \alib{lox;Lox::Reset}.
119 * @param impl The implementation struct of the \b Lox.
120 * @param reInitialze If called from the destructor \c false is passed.
121 * Defaults to \c true and must not be set by callers.
122 **********************************************************************************************/
123 ALIB_API static
124 void Reset(LoxImpl* impl, bool reInitialze= true);
125
126 /** ********************************************************************************************
127 * Implementation of method \alib{lox;Lox::SetSourcePathTrimRule}.
128 * @param impl The implementation struct of the \b Lox.
129 * @param path The path to search for. If not starting with <c> '*'</c>,
130 * a prefix is searched.
131 * @param includeString Determines if \p{path} should be included in the trimmed path or
132 * not.
133 * Optional and defaults to \b %Inclusion::Exclude.
134 * @param trimOffset Adjusts the portion of \p{path} that is trimmed.
135 * Optional and defaults to \c 0.
136 * @param sensitivity Determines if the comparison of \p{path} with a source file's path
137 * is performed case sensitive or not.
138 * Optional and defaults to \b Case::Ignore.
139 * @param trimReplacement Replacement string for trimmed portion of the path.
140 * Optional and defaults to \b %NullString().
141 * @param reach Denotes whether the rule is applied locally (to this \b %Lox only)
142 * or applies to all instances of class \b %Lox.
143 * Defaults to \b %Reach::Global.
144 * @param priority The priority of the setting. Defaults to
145 * \ref alib::config::Priorities "Priorities::DefaultValues".
146 **********************************************************************************************/
147 ALIB_API static
148 void SetSourcePathTrimRule( LoxImpl* impl,
149 const NCString& path,
150 lang::Inclusion includeString ,
151 int trimOffset ,
152 lang::Case sensitivity ,
153 const NString& trimReplacement,
154 lang::Reach reach ,
155 Priorities priority );
156
157
158 /** ********************************************************************************************
159 * Implementation of method \alib{lox;Lox::GetLogger}.
160 * @param impl The implementation struct of the \b Lox.
161 * @param loggerName The name of the \e Logger to search for (case insensitive).
162 * @return The logger, nullptr if not found.
163 **********************************************************************************************/
164 ALIB_API static
165 detail::Logger* GetLogger( LoxImpl* impl, const NString& loggerName );
166
167 /** ********************************************************************************************
168 * Implementation of method \alib{lox;Lox::RemoveLogger}.
169 * @param impl The implementation struct of the \b Lox.
170 * @param logger The logger to be removed.
171 * @returns \c true, if the \e Logger was found and removed, \c false otherwise.
172 **********************************************************************************************/
173 ALIB_API static
174 bool RemoveLogger( LoxImpl* impl, detail::Logger* logger );
175
176 /** ********************************************************************************************
177 * Implementation of method \alib{lox;Lox::RemoveLogger}.
178 * @param impl The implementation struct of the \b Lox.
179 * @param loggerName The name of the \e Logger(s) to be removed (case insensitive).
180 * @returns The logger that was removed, \c nullptr if not found.
181 **********************************************************************************************/
182 ALIB_API static
183 detail::Logger* RemoveLogger( LoxImpl* impl, const NString& loggerName );
184
185 /** ********************************************************************************************
186 * Implementation of method \alib{lox;Lox::SetVerbosity}.
187 * @param impl The implementation struct of the \b Lox.
188 * @param logger The logger to be to be affected (case insensitive).
189 * @param verbosity The 'level of verboseness' to be set.
190 * @param domain The parent (start) domain to be set. The use of absolute paths
191 * starting with <c> '/'</c> are recommended.
192 * Defaults to root domain \"/\".
193 * @param priority The priority of the setting. Defaults to
194 * \ref alib::config::Priorities "Priorities::DefaultValues".
195 **********************************************************************************************/
196 ALIB_API static
197 void SetVerbosity( LoxImpl* impl,
198 detail::Logger* logger,
199 Verbosity verbosity,
200 const NString& domain,
201 Priorities priority );
202
203 /** ********************************************************************************************
204 * Implementation of method \alib{lox;Lox::SetVerbosity}.
205 * @param impl The implementation struct of the \b Lox.
206 * @param loggerName The logger to be to be affected, identified by its name (case
207 * insensitive).
208 * @param verbosity The 'level of verboseness' to be set.
209 * @param domain The parent (start) domain to be set. The use of absolute paths
210 * starting with <c> '/'</c> are recommended.
211 * Defaults to root domain \"/\".
212 * @param priority The priority of the setting. Defaults to
213 * \ref alib::config::Priorities "Priorities::DefaultValues".
214 **********************************************************************************************/
215 ALIB_API static
216 void SetVerbosity( LoxImpl* impl,
217 const NString& loggerName,
218 Verbosity verbosity,
219 const NString& domain,
220 Priorities priority );
221
222
223 /** ********************************************************************************************
224 * Implementation of method \alib{lox;Lox::SetDomain}.
225 * @param impl The implementation struct of the \b Lox.
226 * @param scopeDomain The domain path to register.
227 * @param scope Either \e %Scope::ThreadOuter or \e %Scope::ThreadInner. With other
228 * values, an internal error is logged.
229 * @param thread The thread to set/unset a thread-related Scope Domains for.
230 **********************************************************************************************/
231 ALIB_API static
232 void SetDomain( LoxImpl* impl, const NString& scopeDomain, Scope scope,
233 threads::Thread* thread );
234
235 /** ********************************************************************************************
236 * Implementation of method \alib{lox;Lox::SetDomainSubstitutionRule}.
237 * @param impl The implementation struct of the \b Lox.
238 * @param domainPath The path to search. Has to start with either <c> '/'</c> or <c> '*'</c>.
239 * @param replacement The replacement path.
240 **********************************************************************************************/
241 ALIB_API static
243 const NString& domainPath,
244 const NString& replacement );
245
246 /** ********************************************************************************************
247 * Implementation of method \alib{lox;Lox::RemoveThreadDomain}.
248 * @param impl The implementation struct of the \b Lox.
249 * @param scopeDomain The domain path to register.
250 * @param scope Either \e %Scope::ThreadOuter or \e %Scope::ThreadInner. With other
251 * values, an internal error is logged.
252 * @param thread The thread to set/unset a thread-related Scope Domains for.
253 **********************************************************************************************/
254 ALIB_API static
255 void RemoveThreadDomain( LoxImpl* impl, const NString& scopeDomain, Scope scope,
256 threads::Thread* thread );
257
258
259
260 /** ********************************************************************************************
261 * Implementation of method \alib{lox;Lox::SetPrefix}.
262 * @param impl The implementation struct of the \b Lox.
263 * @param prefix The <em>Prefix Logable</em> to set.
264 * @param domain The domain path. Defaults to \c nullptr, resulting in
265 * evaluated <em>Scope Domain</em> path.
266 * @param otherPLs If set to \c Inclusion::Exclude, scope-related <em>Prefix Logables</em>
267 * are ignored and only domain-related <em>Prefix Logables</em> are passed to
268 * the \e Loggers.
269 **********************************************************************************************/
270 ALIB_API static
271 void SetPrefix( LoxImpl* impl, const Box& prefix, const NString& domain,
272 lang::Inclusion otherPLs );
273
274 /** ********************************************************************************************
275 * Implementation of method \alib{lox;Lox::SetStartTime}.
276 * @param impl The implementation struct of the \b Lox.
277 * @param startTime Optional parameter with the new start time. Defaults
278 * to current time if omitted.
279 * @param loggerName The name of the \e Logger(s) whose start time is to be set
280 * (case insensitive).
281 * Defaults to nullptr, which indicates that all loggers are to
282 * be affected.
283 **********************************************************************************************/
284 ALIB_API static
285 void SetStartTime( LoxImpl* impl,
286 Ticks startTime,
287 const NString& loggerName );
288
289 #if defined (__GLIBCXX__) || defined(__APPLE__) || defined(__ANDROID_NDK__)
290 /** ****************************************************************************************
291 * Implementation of method \alib{lox;Lox::SetStartTime}.
292 * @param impl The implementation struct of the \b Lox.
293 * @param startTime The new start time in system specific time unit.
294 * @param loggerName The name of the \e Logger whose start time is to be set (case
295 * insensitive).
296 * Defaults to empty string, which indicates that all loggers are to
297 * be affected.
298 ******************************************************************************************/
299 ALIB_API static
300 void SetStartTime( LoxImpl* impl, time_t startTime, const NString& loggerName );
301
302
303 #endif // no elif here, otherwise doxygen would ignore it!
304
305 #if defined( _MSC_VER )
306 /** ****************************************************************************************
307 * Implementation of method \alib{lox;Lox::SetStartTime}.
308 * @param impl The implementation struct of the \b Lox.
309 * @param startTime The new start time in system specific time unit.
310 * @param loggerName The name of the \e Logger whose start time is to be set (case
311 * insensitive).
312 * Defaults to empty string, which indicates that all loggers are to
313 * be affected.
314 ******************************************************************************************/
315 ALIB_API static
317 const FILETIME& startTime,
318 const NString& loggerName );
319 #endif
320
321 /** ********************************************************************************************
322 * Implementation of method \alib{lox;Lox::MapThreadName}.
323 * @param impl The implementation struct of the \b Lox.
324 * @param threadName The name of the thread as it should be displayed in the logs.
325 * @param id The thread ID.
326 **********************************************************************************************/
327 ALIB_API static
328 void MapThreadName( LoxImpl* impl, const String& threadName, threads::ThreadID id );
329
330 /** ********************************************************************************************
331 * Implementation of method \alib{lox;Lox::State}.
332 * @param impl The implementation struct of the \b Lox.
333 * @param domain Optional <em>Log Domain</em> which is combined with
334 * <em>%Scope Domains</em> set for the \e %Scope of invocation.
335 * @param verbosity The verbosity.
336 * @param headLine If given, a separated headline will be logged at first place.
337 * @param flags Flag bits that define which state information is logged.
338 **********************************************************************************************/
339 ALIB_API static
340 void State( LoxImpl* impl,
341 const NString& domain,
342 Verbosity verbosity,
343 const String& headLine,
344 StateInfo flags );
345
346 /** ********************************************************************************************
347 * Implementation of method \alib{lox;Lox::GetState}.
348 * @param impl The implementation struct of the \b Lox.
349 * @param buf The target string.
350 * @param flags Bits that define which state information is collected.
351 **********************************************************************************************/
352 ALIB_API static
353 void GetState( LoxImpl* impl, NAString& buf, StateInfo flags );
354
355 /** ********************************************************************************************
356 * Implementation of method \alib{lox;Lox::GetLogableContainer}.
357 * @param impl The implementation struct of the \b Lox.
358 * @return An empty list of boxes.
359 **********************************************************************************************/
360 ALIB_API static
362
363 /** ********************************************************************************************
364 * Implementation of method \alib{lox;Lox::Entry}.
365 * @param impl The implementation struct of the \b Lox.
366 * @param domain The domain.
367 * @param verbosity The verbosity.
368 **********************************************************************************************/
369 ALIB_API static
370 void Entry( LoxImpl* impl, const NString& domain, Verbosity verbosity );
371
372 /** ****************************************************************************************
373 * Implementation of method \alib{lox;Lox::IsActive}.
374 *
375 * @param impl The implementation struct of the \b Lox.
376 * @param verbosity The verbosity to query for activity.
377 * @param domain The log domain. All rules for resolving the effective log domain
378 * apply as with normal log statements.
379 * @return The number of active loggers.
380 ******************************************************************************************/
381 ALIB_API static
382 int IsActive( LoxImpl* impl, Verbosity verbosity, const NString& domain );
383
384// #################################################################################################
385// Debug methods
386// #################################################################################################
387#if ALIB_DEBUG_MONOMEM
388 /** ********************************************************************************************
389 * Implementation of method \alib{lox;Lox::DbgGetMonoAllocator}.
390 * @param impl The implementation struct of the \b Lox.
391 * @return The monotonic allocator of this \b Lox.
392 **********************************************************************************************/
393 ALIB_API static
395#endif
396
397
398// #################################################################################################
399// internals
400// #################################################################################################
401
402 /** ********************************************************************************************
403 * Assembles the resulting domain from the given \p{domainPath} and the Scope Domain paths
404 * (see #SetDomain) according to the scope identified by \p{scopeInfo}.
405 * The resulting full domain string is assembled from inner to outer scope.
406 * If \p{domainPath}, respectively as soon as any of the Scope Domain's paths
407 * start with the character defined with
408 * \ref alib::lox::detail::Domain::Separator "Domain::Separator",
409 * the evaluation is stopped (the path is interpreted as absolute).
410 *
411 * @param impl The implementation struct of the \b Lox.
412 * @param domainPath The domain path. If starting with the character defined with
413 * \ref alib::lox::detail::Domain::Separator "Domain::Separator",
414 * no scope domains are applied.
415 * @return The resulting \ref alib::lox::detail::Domain "Domain".
416 **********************************************************************************************/
417 ALIB_API static
418 detail::Domain* evaluateResultDomain( LoxImpl* impl, const NString& domainPath );
419
420 /** ********************************************************************************************
421 * Invokes \b Find on the given domain and logs internal message when the domain was
422 * not known before.
423 *
424 * @param impl The implementation struct of the \b Lox.
425 * @param domainSystem The domain system. Either the standard or the internal one.
426 * @param domainPath The domain path.
427 * @return The resulting \ref alib::lox::detail::Domain "Domain".
428 **********************************************************************************************/
429 ALIB_API static
430 detail::Domain* findDomain( LoxImpl* impl, detail::Domain& domainSystem, NString domainPath );
431
432 /** ********************************************************************************************
433 * This method is looping over the \e Loggers, checking their verbosity against the given
434 * one, and, if they match, invoke the log method of the \e Logger.
435 * With the first logger identified to be active, the <em>Prefix Objects</em> get
436 * collected from the scope store.
437 * @param impl The implementation struct of the \b Lox.
438 * @param dom The domain to log on
439 * @param verbosity The verbosity.
440 * @param logables The objects to log.
441 * @param prefixes Denotes if prefixes should be included or not.
442 **********************************************************************************************/
443 ALIB_API static
444 void log( LoxImpl* impl,
445 detail::Domain* dom,
446 Verbosity verbosity,
447 Boxes& logables,
448 lang::Inclusion prefixes );
449
450
451 /** ********************************************************************************************
452 * Logs an internal error message using the internal domain tree as defined in
453 * \ref alib::lox::Lox::InternalDomains "Lox::InternalDomains".
454 *
455 * @param impl The implementation struct of the \b Lox.
456 * @param verbosity The verbosity.
457 * @param subDomain The sub-domain of the internal domain to log into.
458 * @param msg The message.
459 **********************************************************************************************/
460 ALIB_API static
461 void logInternal( LoxImpl* impl, Verbosity verbosity, const NString& subDomain,
462 Boxes& msg );
463
464 /** ********************************************************************************************
465 * Overloaded version accepting a string to log.
466 *
467 * @param impl The implementation struct of the \b Lox.
468 * @param verbosity The verbosity.
469 * @param subDomain The sub-domain of the internal domain to log into.
470 * @param msg The message.
471 **********************************************************************************************/
472 ALIB_API static
473 void logInternal( LoxImpl* impl, Verbosity verbosity, const NString& subDomain,
474 const NString& msg );
475
476 /** ********************************************************************************************
477 * Returns a reference to a list of boxes to be used by internal logging.
478 * Each invocation has to be followed by an invocation to #logInternal
479 * which releases the logables.
480 *
481 * @param impl The implementation struct of the \b Lox.
482 * @return A list of boxes.
483 **********************************************************************************************/
484 ALIB_API static
486
487 /** ********************************************************************************************
488 * Implementation of the interface method fetching all possible parameters.
489 *
490 * @param impl The implementation struct of the \b Lox.
491 * @param scopeDomain The domain path to register.
492 * @param scope The scope that the given \p{domain} should be registered for.
493 * Available Scope definitions are platform/language dependent.
494 * @param removeNTRSD Used to remove a named thread-related Scope Domain (and is true only
495 * when invoked by interface method #RemoveThreadDomain.
496 * @param thread The thread to set/unset a thread-related Scope Domain for.
497 **********************************************************************************************/
498 ALIB_API static
499 void setDomain( LoxImpl* impl, const NString& scopeDomain, Scope scope,
500 bool removeNTRSD, threads::Thread* thread );
501
502 /** ********************************************************************************************
503 * Implementation of the interface method fetching all possible parameters.
504 *
505 * @param impl The implementation struct of the \b Lox.
506 * @param prefix The <em>Prefix Logable</em> to set.
507 * @param scope The scope that the given \p{logable} should be registered for.
508 * Available Scope definitions are platform/language dependent.
509 * @param thread The thread to set/unset a thread-related <em>Prefix Logable</em> for.
510 **********************************************************************************************/
511 ALIB_API static
512 void setPrefix( LoxImpl* impl, const Box& prefix, Scope scope, threads::Thread* thread );
513
514 /** ********************************************************************************************
515 * Increases the internal log counter of \p{impl}.
516 * @param impl The implementation struct of the \b Lox.
517 **********************************************************************************************/
518 ALIB_API static
519 void IncreaseLogCounter( LoxImpl* impl);
520
521 /** ********************************************************************************************
522 * Implementation of method \alib{lox;Lox::EntryDetectDomain}.
523 *
524 * @param impl The implementation struct of the \b Lox.
525 * @param verbosity The verbosity.
526 **********************************************************************************************/
527 ALIB_API static
528 void entryDetectDomainImpl( LoxImpl* impl, Verbosity verbosity);
529
530 /** ********************************************************************************************
531 * Internal method serving public interface \alib{lox;Lox::Once}.
532 *
533 * @param impl The implementation struct of the \b Lox.
534 * @param domain Optional <em>Log Domain</em> which is combined with
535 * <em>%Scope Domains</em> set for the \e %Scope of invocation.
536 * @param verbosity The verbosity of the <em>Log Statement</em> (if performed).
537 * @param logables The objects to log (Multiple objects may be provided within
538 * container class Boxes.)
539 * @param pGroup The optional name of the statement group. If used, all statements that
540 * share the same group name are working on the same counter (according
541 * to the \p{scope}.)
542 * If omitted (or empty or nullptr), the counter is bound to the
543 * \e %Scope provided. If omitted and \p{scope} is Scope::Global, then the
544 * counter is associated exclusively with the single <em>Log Statement</em>
545 * itself.
546 * @param scope The \e %Scope that the group or counter is bound to.
547 * @param quantity The number of logs to be performed. As the name of the method indicates,
548 * this defaults to \c 1.
549 **********************************************************************************************/
550 ALIB_API static
551 void once( LoxImpl* impl , const NString& domain, Verbosity verbosity,
552 const Box& logables, const String& pGroup, Scope scope,
553 int quantity );
554
555 /** ********************************************************************************************
556 * Internal method serving public interface \alib{lox;Lox::Store}.
557 *
558 * @param impl The implementation struct of the \b Lox.
559 * @param data The data object to store.
560 * In C++, has to be heap allocated and will be deleted
561 * by this \b %Lox when overwritten or this lox is deleted.
562 * @param pKey The key to the data.
563 * @param scope The \e %Scope that the data is bound to.
564 **********************************************************************************************/
565 ALIB_API static
566 void store( LoxImpl* impl, const Box& data, const NString& pKey, Scope scope );
567
568 /** ********************************************************************************************
569 * Internal method serving public interface \alib{lox;Lox::Retrieve}.
570 *
571 * @param impl The implementation struct of the \b Lox.
572 * @param pKey The key to the data.
573 * @param scope The \e %Scope that the data is bound to.
574 * @return The data, a \e nulled box if no value was found.
575 **********************************************************************************************/
576 ALIB_API static
577 Box retrieve( LoxImpl* impl, const NString& pKey, Scope scope );
578
579 /** ********************************************************************************************
580 * Checks if given scope is thread-related.
581 *
582 * @param impl The implementation struct of the \b Lox.
583 * @param scope The scope that is to be checked.
584 * @return \c true if \p{scope} is thread-related, \c false else.
585 **********************************************************************************************/
586 ALIB_API static
587 bool isThreadRelatedScope( LoxImpl* impl, Scope scope );
588
589 /** ********************************************************************************************
590 * Checks if given scope needs information that is not available. In addition, the
591 * in/out parameter \p{scope} is changed to \b Scope::Path, in case a level was added.
592 *
593 * @param impl The implementation struct of the \b Lox.
594 * @param[in,out] scope A reference to the scope that is to be checked (and eventually
595 * modified.
596 * @param internalDomain The internal sub-domain to log any error/warning into.
597 * @return A positive value providing the path level deduced from \p{scope} if all is fine,
598 * \c -1 else.
599 **********************************************************************************************/
600 ALIB_API static
601 int checkScopeInformation( LoxImpl* impl , Scope& scope,
602 const NString& internalDomain );
603
604 /** ********************************************************************************************
605 * Used on construction and with #Reset.
606 * @param impl The implementation struct of the \b Lox.
607 **********************************************************************************************/
608 ALIB_API static
609 void init(LoxImpl* impl);
610
611 /** ********************************************************************************************
612 * Reads the verbosity for the given logger and domain from the \alib configuration system.
613 * This internal method is used in two occasions:
614 * - when a new logger is added: recursively for all existing domains (\p{configStr} is
615 * given)
616 * - when a new domain is created on the fly(\p{configStr} is not given)
617 *
618 * The variable is already read and found in an internal instance.
619 *
620 * @param impl The implementation struct of the \b Lox.
621 * @param logger The logger to set the verbosity for.
622 * @param dom The domain to set the verbosity for.
623 **********************************************************************************************/
624 ALIB_API static
625 void getVerbosityFromConfig( LoxImpl* impl, detail::Logger* logger,
626 detail::Domain& dom );
627
628 /** ********************************************************************************************
629 * Reads a prefix string from the \alib configuration system.
630 * This internal method is used when a new domain is created,
631 *
632 * @param impl The implementation struct of the \b Lox.
633 * @param dom The domain to set the verbosity for.
634 **********************************************************************************************/
635 ALIB_API static
637
638
639 /** ********************************************************************************************
640 * Reads the verbosity for the given logger and domain from the \alib configuration system.
641 * This internal method is used when a new logger is added.
642 * Walks recursively for all existing domains.
643 *
644 * @param impl The implementation struct of the \b Lox.
645 * @param logger The logger to set the verbosity for.
646 * @param dom The domain to set the verbosity for.
647 **********************************************************************************************/
648 ALIB_API static
649 void getAllVerbosities( LoxImpl* impl, detail::Logger* logger, detail::Domain& dom );
650
651 /** ********************************************************************************************
652 * Implements functionality for configuration variable \c LOXNAME_DUMP_STATE_ON_EXIT.
653 * Is called when a logger is removed.
654 * @param impl The implementation struct of the \b Lox.
655 **********************************************************************************************/
656 ALIB_API static
658
659 /** ********************************************************************************************
660 * Implements functionality for configuration variable \c LOXNAME_LOGGERNAME_VERBOSITY.
661 * Is called when a logger is removed.
662 * @param impl The implementation struct of the \b Lox.
663 * @param logger The logger to write the verbosity for.
664 **********************************************************************************************/
665 ALIB_API static
666 void writeVerbositiesOnLoggerRemoval( LoxImpl* impl, Logger* logger );
667
668#if ALIB_THREADS
669 /** ********************************************************************************************
670 * Returns the internal lock.
671 * @param impl The implementation struct of the \b Lox.
672 * @returns The internal \b ThreadLock of this \b %Lox.
673 **********************************************************************************************/
674 ALIB_API static
676#endif
677
678}; // struct LI
679
680}}} // namespace [alib::lox::detail]
681
682#endif // HPP_ALOX_DETAIL_LOXPIMPL
#define ALIB_API
Definition alib.hpp:538
StateInfo
Definition lox.inl:40
integer ThreadID
Definition loxpimpl.inl:34
Definition alib.cpp:57
@ Destruct
The main phase of termination that destructs everything.
lang::integer integer
Type alias in namespace alib.
Definition integers.hpp:286
static ALIB_API void logInternal(LoxImpl *impl, Verbosity verbosity, const NString &subDomain, Boxes &msg)
static ALIB_API void writeVerbositiesOnLoggerRemoval(LoxImpl *impl, Logger *logger)
Definition loxpimpl.cpp:608
static ALIB_API void SetSourcePathTrimRule(LoxImpl *impl, const NCString &path, lang::Inclusion includeString, int trimOffset, lang::Case sensitivity, const NString &trimReplacement, lang::Reach reach, Priorities priority)
Definition loxpimpl.cpp:555
static ALIB_API void entryDetectDomainImpl(LoxImpl *impl, Verbosity verbosity)
static ALIB_API void SetStartTime(LoxImpl *impl, Ticks startTime, const NString &loggerName)
static ALIB_API void SetDomainSubstitutionRule(LoxImpl *impl, const NString &domainPath, const NString &replacement)
static ALIB_API void setDomain(LoxImpl *impl, const NString &scopeDomain, Scope scope, bool removeNTRSD, threads::Thread *thread)
Definition loxpimpl.cpp:988
static ALIB_API detail::Logger * GetLogger(LoxImpl *impl, const NString &loggerName)
Definition loxpimpl.cpp:579
static ALIB_API void log(LoxImpl *impl, detail::Domain *dom, Verbosity verbosity, Boxes &logables, lang::Inclusion prefixes)
static ALIB_API void RemoveThreadDomain(LoxImpl *impl, const NString &scopeDomain, Scope scope, threads::Thread *thread)
static ALIB_API void getDomainPrefixFromConfig(LoxImpl *impl, detail::Domain &dom)
static ALIB_API detail::Domain * evaluateResultDomain(LoxImpl *impl, const NString &domainPath)
static ALIB_API int checkScopeInformation(LoxImpl *impl, Scope &scope, const NString &internalDomain)
static ALIB_API bool RemoveLogger(LoxImpl *impl, detail::Logger *logger)
Definition loxpimpl.cpp:782
static ALIB_API void init(LoxImpl *impl)
Definition loxpimpl.cpp:332
static ALIB_API void store(LoxImpl *impl, const Box &data, const NString &pKey, Scope scope)
static ALIB_API void Release(LoxImpl *impl)
Definition loxpimpl.cpp:322
static ALIB_API void getAllVerbosities(LoxImpl *impl, detail::Logger *logger, detail::Domain &dom)
static ALIB_API void getVerbosityFromConfig(LoxImpl *impl, detail::Logger *logger, detail::Domain &dom)
static ALIB_API Boxes & acquireInternalLogables(LoxImpl *impl)
static ALIB_API bool isThreadRelatedScope(LoxImpl *impl, Scope scope)
static ALIB_API void IncreaseLogCounter(LoxImpl *impl)
static ALIB_API void Construct(Lox *lox, const NString &name, bool doRegister)
Definition loxpimpl.cpp:269
static ALIB_API void Reset(LoxImpl *impl, bool reInitialze=true)
Definition loxpimpl.cpp:379
static ALIB_API Boxes & GetLogableContainer(LoxImpl *impl)
static ALIB_API void SetStartTime(LoxImpl *impl, const FILETIME &startTime, const NString &loggerName)
static ALIB_API void setPrefix(LoxImpl *impl, const Box &prefix, Scope scope, threads::Thread *thread)
static ALIB_API detail::Domain * findDomain(LoxImpl *impl, detail::Domain &domainSystem, NString domainPath)
static ALIB_API void GetState(LoxImpl *impl, NAString &buf, StateInfo flags)
static ALIB_API void MapThreadName(LoxImpl *impl, const String &threadName, threads::ThreadID id)
static ALIB_API void State(LoxImpl *impl, const NString &domain, Verbosity verbosity, const String &headLine, StateInfo flags)
static ALIB_API void dumpStateOnLoggerRemoval(LoxImpl *impl)
Definition loxpimpl.cpp:707
static ALIB_API Box retrieve(LoxImpl *impl, const NString &pKey, Scope scope)
static ALIB_API integer & GetLogCounter(LoxImpl *impl)
Definition loxpimpl.cpp:296
static ALIB_API const NString & GetName(LoxImpl *impl)
Definition loxpimpl.cpp:291
static ALIB_API void SetDomain(LoxImpl *impl, const NString &scopeDomain, Scope scope, threads::Thread *thread)
Definition loxpimpl.cpp:569
static ALIB_API void Entry(LoxImpl *impl, const NString &domain, Verbosity verbosity)
static ALIB_API monomem::MonoAllocator & DbgGetMonoAllocator(LoxImpl *impl)
static ALIB_API void once(LoxImpl *impl, const NString &domain, Verbosity verbosity, const Box &logables, const String &pGroup, Scope scope, int quantity)
static ALIB_API void Acquire(LoxImpl *impl, const NCString &file, int line, const NCString &func)
Definition loxpimpl.cpp:309
static ALIB_API void SetPrefix(LoxImpl *impl, const Box &prefix, const NString &domain, lang::Inclusion otherPLs)
static ALIB_API void SetVerbosity(LoxImpl *impl, detail::Logger *logger, Verbosity verbosity, const NString &domain, Priorities priority)
Definition loxpimpl.cpp:849
static ALIB_API int IsActive(LoxImpl *impl, Verbosity verbosity, const NString &domain)
static ALIB_API threads::ThreadLock & getLock(LoxImpl *impl)
Definition loxpimpl.cpp:302