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