ALib C++ Library
Library Version: 2510 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
logtools.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 { namespace lox {
9
10//==================================================================================================
11/// Simple class with static tool functions.
12/// Currently the only functionality is logging objects of type \alib{exceptions;Exception}.
13//==================================================================================================
15{
16 public:
17 /// Logs an \b %alib::Exception. If available, the correct source information is used for
18 /// each entry.
19 ///
20 /// Parameter \p{domainPrefix} and \p{logPrefix} are both set on outer thread scope (using
21 /// \ref alib::lox::Lox::SetDomain "SetDomain( domainPrefix, Scope::ThreadOuter )" and
22 /// \ref alib::lox::Lox::SetPrefix "SetPrefix( logPrefix, Scope::ThreadOuter )".
23 /// The reason for this approach is that it may occur that other prefixes or scope domains
24 /// are set set on source scope for the source files and methods found in the exception
25 /// entry's source code information. This is especially important to understand in respect
26 /// to the log domain: With the default value of parameter \p{domainPrefix} being \e "/ERR",
27 /// all source related domains will appear as a subdomain of \e "/ERR" when the exception
28 /// is logged using this tool function.
29 ///
30 /// @param lox The lox to log into.
31 /// @param e The exception to log.
32 /// @param verbosity The verbosity of the log output.<br>
33 /// Defaults to \b Verbosity::Error.
34 /// @param domainPrefix The domain to log into. If nulled , no domain is set and
35 /// the default domain is used instead.<br>
36 /// Defaults to \e "/ERR".
37 /// @param logPrefix A log prefix string. If nulled, no prefix is set.<br>
38 /// Defaults to <b>" "</b> (two spaces).
40 static void Exception( Lox& lox,
41 const exceptions::Exception& e,
42 Verbosity verbosity = Verbosity::Error,
43 const NString& domainPrefix = "/ERR",
44 const String& logPrefix = A_CHAR(" ") );
45}; // class LogTools
46
47} // namespace alib[::lox]
48
49/// Type alias in namespace \b alib.
51
52} // namespace [alib]
53
This class acts as a container for Loggers and provides a convenient interface to logging.
Definition lox.inl:15
#define ALIB_DLL
Definition alib.inl:496
#define A_CHAR(STR)
#define ALIB_EXPORT
Definition alib.inl:488
strings::TString< nchar > NString
Type alias in namespace alib.
Definition string.inl:2390
lox::LogTools LogTools
Type alias in namespace alib.
Definition logtools.inl:50
exceptions::Exception Exception
Type alias in namespace alib.
strings::TString< character > String
Type alias in namespace alib.
Definition string.inl:2381