log4cplus
2.0.6
include
log4cplus
win32consoleappender.h
Go to the documentation of this file.
1
// -*- C++ -*-
2
// Copyright (C) 2009-2017, Vaclav Haisman. All rights reserved.
3
//
4
// Redistribution and use in source and binary forms, with or without modifica-
5
// tion, are permitted provided that the following conditions are met:
6
//
7
// 1. Redistributions of source code must retain the above copyright notice,
8
// this list of conditions and the following disclaimer.
9
//
10
// 2. Redistributions in binary form must reproduce the above copyright notice,
11
// this list of conditions and the following disclaimer in the documentation
12
// and/or other materials provided with the distribution.
13
//
14
// THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
15
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16
// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
17
// APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
18
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
19
// DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
20
// OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
21
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23
// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
25
#ifndef LOG4CPLUS_WIN32CONSOLEAPPENDER_H
26
#define LOG4CPLUS_WIN32CONSOLEAPPENDER_H
27
28
#include <
log4cplus/config.hxx
>
29
30
#if defined (LOG4CPLUS_HAVE_PRAGMA_ONCE)
31
#pragma once
32
#endif
33
34
#if defined(_WIN32) && defined (LOG4CPLUS_HAVE_WIN32_CONSOLE)
35
36
#include <
log4cplus/appender.h
>
37
38
39
namespace
log4cplus
40
{
41
63
class
LOG4CPLUS_EXPORT
Win32ConsoleAppender
64
:
public
Appender
65
{
66
public
:
67
explicit
Win32ConsoleAppender
(
bool
allocConsole =
true
,
68
bool
logToStdErr =
false
,
unsigned
int
textColor = 0);
69
Win32ConsoleAppender
(
helpers::Properties
const
& properties);
70
virtual
~
Win32ConsoleAppender
();
71
72
virtual
void
close ();
73
74
protected
:
75
virtual
void
append (
spi::InternalLoggingEvent
const
&);
76
77
void
write_handle (
void
*,
tchar
const
*, std::size_t);
78
void
write_console (
void
*,
tchar
const
*, std::size_t);
79
80
bool
alloc_console
;
81
bool
log_to_std_err
;
82
unsigned
int
text_color
;
83
84
private
:
85
Win32ConsoleAppender
(
Win32ConsoleAppender
const
&);
86
Win32ConsoleAppender
& operator = (
Win32ConsoleAppender
const
&);
87
};
88
89
}
// namespace log4cplus
90
91
#endif
92
93
#endif // LOG4CPLUS_WIN32CONSOLEAPPENDER_H
log4cplus
Definition:
appender.h:46
log4cplus::Win32ConsoleAppender::text_color
unsigned int text_color
Definition:
win32consoleappender.h:82
log4cplus::tchar
char tchar
Definition:
tchar.h:56
log4cplus::Win32ConsoleAppender::log_to_std_err
bool log_to_std_err
Definition:
win32consoleappender.h:81
config.hxx
log4cplus::helpers::Properties
Definition:
property.h:43
log4cplus::spi::InternalLoggingEvent
The internal representation of logging events.
Definition:
loggingevent.h:51
log4cplus::Win32ConsoleAppender::alloc_console
bool alloc_console
Definition:
win32consoleappender.h:80
LOG4CPLUS_EXPORT
#define LOG4CPLUS_EXPORT
Definition:
win32.h:141
log4cplus::Win32ConsoleAppender
Prints events to Win32 console.
Definition:
win32consoleappender.h:63
appender.h
log4cplus::Appender
Extend this class for implementing your own strategies for printing log statements.
Definition:
appender.h:137
Generated on Fri Jun 18 2021 08:46:20 for log4cplus by
1.8.17