open62541pp
0.16.0
C++ wrapper of open62541
Loading...
Searching...
No Matches
include
open62541pp
plugin
log.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <string_view>
4
5
#include "
open62541pp/detail/open62541/common.h
"
// UA_LogLevel, UA_LogCategory, UA_Logger
6
#include "
open62541pp/plugin/pluginadapter.hpp
"
7
8
namespace
opcua
{
9
10
/**
11
* Log level.
12
* @see UA_LogLevel
13
*/
14
enum class
LogLevel
{
15
Trace
=
UA_LOGLEVEL_TRACE
,
16
Debug
=
UA_LOGLEVEL_DEBUG
,
17
Info
=
UA_LOGLEVEL_INFO
,
18
Warning
=
UA_LOGLEVEL_WARNING
,
19
Error
=
UA_LOGLEVEL_ERROR
,
20
Fatal
=
UA_LOGLEVEL_FATAL
,
21
};
22
23
/**
24
* Log category.
25
* @see UA_LogCategory
26
*/
27
enum class
LogCategory
{
28
Network
=
UA_LOGCATEGORY_NETWORK
,
29
SecureChannel
=
UA_LOGCATEGORY_SECURECHANNEL
,
30
Session
=
UA_LOGCATEGORY_SESSION
,
31
Server
=
UA_LOGCATEGORY_SERVER
,
32
Client
=
UA_LOGCATEGORY_CLIENT
,
33
Userland
=
UA_LOGCATEGORY_USERLAND
,
34
SecurityPolicy
=
UA_LOGCATEGORY_SECURITYPOLICY
,
35
};
36
37
/**
38
* Logger base class.
39
*
40
* Custom logger can be implemented by deriving from this class and overwriting the log function.
41
*/
42
class
LoggerBase
:
public
PluginAdapter
<UA_Logger> {
43
public
:
44
virtual
void
log
(
LogLevel
level,
LogCategory
category, std::string_view msg) = 0;
45
46
UA_Logger
create
(
bool
ownsAdapter)
override
;
47
};
48
49
namespace
detail {
50
void
clear
(
UA_Logger
& logger)
noexcept
;
51
}
// namespace detail
52
53
}
// namespace opcua
opcua::Client
High-level client class.
Definition
client.hpp:121
opcua::LoggerBase
Logger base class.
Definition
log.hpp:42
opcua::LoggerBase::create
UA_Logger create(bool ownsAdapter) override
opcua::LoggerBase::log
virtual void log(LogLevel level, LogCategory category, std::string_view msg)=0
opcua::PluginAdapter
Base class to implement plugin adapters.
Definition
pluginadapter.hpp:19
opcua::Server
High-level server class.
Definition
server.hpp:132
opcua::Session
High-level session class to manage client sessions.
Definition
session.hpp:20
common.h
UA_LOGLEVEL_TRACE
UA_LOGLEVEL_TRACE
UA_LOGLEVEL_DEBUG
UA_LOGLEVEL_DEBUG
UA_LOGLEVEL_INFO
UA_LOGLEVEL_INFO
UA_LOGLEVEL_ERROR
UA_LOGLEVEL_ERROR
UA_LOGLEVEL_WARNING
UA_LOGLEVEL_WARNING
UA_LOGLEVEL_FATAL
UA_LOGLEVEL_FATAL
UA_LOGCATEGORY_NETWORK
UA_LOGCATEGORY_NETWORK
UA_LOGCATEGORY_USERLAND
UA_LOGCATEGORY_USERLAND
UA_LOGCATEGORY_SERVER
UA_LOGCATEGORY_SERVER
UA_LOGCATEGORY_SESSION
UA_LOGCATEGORY_SESSION
UA_LOGCATEGORY_SECURITYPOLICY
UA_LOGCATEGORY_SECURITYPOLICY
UA_LOGCATEGORY_CLIENT
UA_LOGCATEGORY_CLIENT
UA_LOGCATEGORY_SECURECHANNEL
UA_LOGCATEGORY_SECURECHANNEL
opcua::detail::clear
constexpr void clear(T &native, const UA_DataType &type) noexcept
Definition
types_handling.hpp:62
opcua
Definition
async.hpp:11
opcua::LogLevel
LogLevel
Log level.
Definition
log.hpp:14
opcua::LogLevel::Warning
@ Warning
opcua::LogLevel::Info
@ Info
opcua::LogLevel::Fatal
@ Fatal
opcua::LogLevel::Error
@ Error
opcua::LogLevel::Debug
@ Debug
opcua::LogLevel::Trace
@ Trace
opcua::LogCategory
LogCategory
Log category.
Definition
log.hpp:27
opcua::LogCategory::SecurityPolicy
@ SecurityPolicy
opcua::LogCategory::Userland
@ Userland
opcua::LogCategory::Network
@ Network
opcua::LogCategory::SecureChannel
@ SecureChannel
pluginadapter.hpp
UA_Logger
Generated by
1.11.0