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