OpenVPN 3 Core Library
Loading...
Searching...
No Matches
logfile.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
#pragma once
13
14
#include <
openvpn/log/logbase.hpp
>
15
#include <
openvpn/win/logutil.hpp
>
16
17
namespace
openvpn::Win
{
18
19
class
LogFile
:
public
LogBase
20
{
21
public
:
22
typedef
RCPtr<LogFile>
Ptr
;
23
24
LogFile
(
const
std::string &fn,
25
const
std::string &sddl_string,
26
bool
append)
27
:
log_handle
(LogUtil::create_file(fn, sddl_string, append)),
28
log_context
(this)
29
{
30
}
31
32
virtual
void
log
(
const
std::string &str)
override
33
{
34
LogUtil::log
(
log_handle
(), str);
35
}
36
37
private
:
38
ScopedHANDLE
log_handle
;
39
Log::Context
log_context
;
// must be initialized last
40
};
41
42
}
// namespace openvpn::Win
openvpn::RCPtr
The smart pointer class.
Definition
rc.hpp:119
openvpn::Win::LogFile
Definition
logfile.hpp:20
openvpn::Win::LogFile::LogFile
LogFile(const std::string &fn, const std::string &sddl_string, bool append)
Definition
logfile.hpp:24
openvpn::Win::LogFile::log
virtual void log(const std::string &str) override
Definition
logfile.hpp:32
openvpn::Win::LogFile::log_handle
ScopedHANDLE log_handle
Definition
logfile.hpp:38
openvpn::Win::LogFile::Ptr
RCPtr< LogFile > Ptr
Definition
logfile.hpp:22
openvpn::Win::LogFile::log_context
Log::Context log_context
Definition
logfile.hpp:39
openvpn::Win::ScopedHANDLE
Definition
scoped_handle.hpp:24
logbase.hpp
logutil.hpp
openvpn::Win::LogUtil::log
void log(const HANDLE file, const std::string &str)
Definition
logutil.hpp:27
openvpn::Win
Definition
call.hpp:27
openvpn::LogBase
The logging interface, simple, logs a string.
Definition
logbase_class.hpp:26
openvpn::Log::Context
Scoped RAII for the global_log pointer.
Definition
logdatetime.hpp:33
openvpn
win
logfile.hpp
Generated by
1.9.8