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 << std::endl
24
25
// like OPENVPN_LOG but no trailing newline
26
#define OPENVPN_LOG_NTNL(args) OPENVPN_LOG_STREAM << date_time() << ' ' << args
27
28
#define OPENVPN_LOG_STRING(str) OPENVPN_LOG_STREAM << date_time() << ' ' << (str)
29
30
// no-op constructs normally used with logthread.hpp
31
namespace
openvpn::Log
{
32
struct
Context
33
{
34
struct
Wrapper
35
{
36
};
37
Context
(
const
Wrapper
&)
38
{
39
}
40
};
41
}
// namespace openvpn::Log
openvpn::Log
Definition
logdatetime.hpp:31
openvpn::Log::Context::Wrapper
Argument to construct a Context in a different thread.
Definition
logdatetime.hpp:35
openvpn::Log::Context
Scoped RAII for the global_log pointer.
Definition
logdatetime.hpp:33
openvpn::Log::Context::Context
Context(const Wrapper &)
Definition
logdatetime.hpp:37
timestr.hpp
openvpn
log
logdatetime.hpp
Generated by
1.9.8