log4cplus
2.0.6
include
log4cplus
asyncappender.h
Go to the documentation of this file.
1
// -*- C++ -*-
2
// Module: Log4cplus
3
// File: asyncappender.h
4
// Created: 1/2009
5
// Author: Vaclav Haisman
6
//
7
//
8
// Copyright (C) 2009-2017, Vaclav Haisman. All rights reserved.
9
//
10
// Redistribution and use in source and binary forms, with or without modifica-
11
// tion, are permitted provided that the following conditions are met:
12
//
13
// 1. Redistributions of source code must retain the above copyright notice,
14
// this list of conditions and the following disclaimer.
15
//
16
// 2. Redistributions in binary form must reproduce the above copyright notice,
17
// this list of conditions and the following disclaimer in the documentation
18
// and/or other materials provided with the distribution.
19
//
20
// THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
21
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
22
// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23
// APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
24
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
25
// DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
26
// OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
27
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29
// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
31
32
//
33
36
#ifndef LOG4CPLUS_ASYNCAPPENDER_H
37
#define LOG4CPLUS_ASYNCAPPENDER_H
38
39
#include <
log4cplus/config.hxx
>
40
41
#if defined (LOG4CPLUS_HAVE_PRAGMA_ONCE)
42
#pragma once
43
#endif
44
45
#ifndef LOG4CPLUS_SINGLE_THREADED
46
47
#include <
log4cplus/helpers/queue.h
>
48
#include <
log4cplus/appender.h
>
49
#include <
log4cplus/thread/threads.h
>
50
#include <
log4cplus/helpers/appenderattachableimpl.h
>
51
52
53
namespace
log4cplus
54
{
55
56
77
class
LOG4CPLUS_EXPORT
AsyncAppender
78
:
public
Appender
79
,
public
helpers::AppenderAttachableImpl
80
{
81
public
:
82
AsyncAppender
(
SharedAppenderPtr
const
& app,
unsigned
max_len);
83
AsyncAppender
(
helpers::Properties
const
&);
84
virtual
~
AsyncAppender
();
85
86
virtual
void
close ();
87
88
protected
:
89
virtual
void
append (
spi::InternalLoggingEvent
const
&);
90
91
void
init_queue_thread (
unsigned
);
92
93
thread::AbstractThreadPtr
queue_thread
;
94
thread::QueuePtr
queue
;
95
96
private
:
97
AsyncAppender
(
AsyncAppender
const
&);
98
AsyncAppender
& operator = (
AsyncAppender
const
&);
99
};
100
101
102
typedef
helpers::SharedObjectPtr<AsyncAppender>
AsyncAppenderPtr
;
103
104
105
}
// namespace log4cplus
106
107
108
#endif // LOG4CPLUS_SINGLE_THREADED
109
110
#endif // LOG4CPLUS_ASYNCAPPENDER_H
log4cplus::helpers::AppenderAttachableImpl
This Interface is for attaching Appenders to objects.
Definition:
appenderattachableimpl.h:48
appenderattachableimpl.h
log4cplus
Definition:
appender.h:46
log4cplus::helpers::SharedObjectPtr
Definition:
pointer.h:100
log4cplus::AsyncAppender
This Appender is a wrapper to which other appenders can be attached.
Definition:
asyncappender.h:77
threads.h
log4cplus::AsyncAppender::queue
thread::QueuePtr queue
Definition:
asyncappender.h:94
log4cplus::AsyncAppenderPtr
helpers::SharedObjectPtr< AsyncAppender > AsyncAppenderPtr
Definition:
asyncappender.h:102
config.hxx
log4cplus::helpers::Properties
Definition:
property.h:43
queue.h
log4cplus::spi::InternalLoggingEvent
The internal representation of logging events.
Definition:
loggingevent.h:51
LOG4CPLUS_EXPORT
#define LOG4CPLUS_EXPORT
Definition:
win32.h:141
appender.h
log4cplus::Appender
Extend this class for implementing your own strategies for printing log statements.
Definition:
appender.h:137
log4cplus::AsyncAppender::queue_thread
thread::AbstractThreadPtr queue_thread
Definition:
asyncappender.h:93
Generated on Fri Jun 18 2021 08:46:20 for log4cplus by
1.8.17