OpenVPN 3 Core Library
Loading...
Searching...
No Matches
logdatetime.hpp
Go to the documentation of this file.
1
// OpenVPN -- An application to securely tunnel IP networks
2
// over a single port, with support for SSL/TLS-based
3
// session authentication and key exchange,
4
// packet encryption, packet authentication, and
5
// packet compression.
6
//
7
// Copyright (C) 2012- OpenVPN Inc.
8
//
9
// SPDX-License-Identifier: MPL-2.0 OR AGPL-3.0-only WITH openvpn3-openssl-exception
10
//
11
12
// Simple logging with data/time prepend
13
14
#pragma once
15
16
#include <iostream>
17
#include <
openvpn/time/timestr.hpp
>
18
19
#ifndef OPENVPN_LOG_STREAM
20
#define OPENVPN_LOG_STREAM std::cout
21
#endif
22
23
#define OPENVPN_LOG(args) OPENVPN_LOG_STREAM << date_time() << ' ' << args << "\n" \
24
<< std::flush
25
26
// like OPENVPN_LOG but no trailing newline
27
#define OPENVPN_LOG_NTNL(args) OPENVPN_LOG_STREAM << date_time() << ' ' << args
28
29
#define OPENVPN_LOG_STRING(str) OPENVPN_LOG_STREAM << date_time() << ' ' << (str)
30
31
// no-op constructs normally used with logthread.hpp
32
namespace
openvpn::Log
{
33
struct
Context
34
{
35
struct
Wrapper
36
{
37
};
38
Context
(
const
Wrapper
&)
39
{
40
}
41
};
42
}
// namespace openvpn::Log
openvpn::Log
Definition
logdatetime.hpp:32
openvpn::Log::Context::Wrapper
Argument to construct a Context in a different thread.
Definition
logdatetime.hpp:36
openvpn::Log::Context
Scoped RAII for the global_log pointer.
Definition
logdatetime.hpp:34
openvpn::Log::Context::Context
Context(const Wrapper &)
Definition
logdatetime.hpp:38
timestr.hpp
openvpn
log
logdatetime.hpp
Generated by
1.9.8