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