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