ALib C++ Framework
by
Library Version: 2511 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 #"mainpage_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 #"LogTools::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 /// #"Lox::SetDomain(const NString&, Scope)" and #"Lox::SetPrefix(const Box&, Scope)".
22 /// The reason for this approach is that it may occur that other prefixes or scope domains
23 /// are set on source scope for the source files and methods found in the exception
24 /// entry's source code information. This is especially important to understand in respect
25 /// to the log domain: With the default value of parameter \p{domainPrefix} being \e "/ERR",
26 /// all source related domains will appear as a subdomain of \e "/ERR" when the exception
27 /// is logged using this tool function.
28 ///
29 /// @param lox The lox to log into.
30 /// @param e The exception to log.
31 /// @param verbosity The verbosity of the log output.<br>
32 /// Defaults to \b Verbosity::Error.
33 /// @param domainPrefix The domain to log into. If nulled , no domain is set and
34 /// the default domain is used instead.<br>
35 /// Defaults to \e "/ERR".
36 /// @param logPrefix A log prefix string. If nulled, no prefix is set.<br>
37 /// Defaults to <b>" "</b> (two spaces).
39 static void Exception( Lox& lox,
40 const exceptions::Exception& e,
41 Verbosity verbosity = Verbosity::Error,
42 const NString& domainPrefix = "/ERR",
43 const String& logPrefix = A_CHAR(" ") );
44}; // class LogTools
45
46} // namespace alib[::lox]
47
48/// Type alias in namespace \b alib.
50
51} // namespace [alib]
#define ALIB_DLL
Definition alib.inl:573
#define A_CHAR(STR)
Definition alib.inl:1325
#define ALIB_EXPORT
Definition alib.inl:562
This class acts as a container for Loggers and provides a convenient interface to logging.
Definition lox.inl:14
strings::TString< nchar > NString
Type alias in namespace alib.
Definition string.inl:2181
lox::LogTools LogTools
Type alias in namespace alib.
Definition logtools.inl:49
strings::TString< character > String
Type alias in namespace alib.
Definition string.inl:2172
exceptions::Exception Exception
Type alias in namespace alib.