Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
src
OstreamAppender.cpp
Go to the documentation of this file.
1
/*
2
* OstreamAppender.cpp
3
*
4
* Copyright 2000, LifeLine Networks BV (www.lifeline.nl). All rights reserved.
5
* Copyright 2000, Bastiaan Bakker. All rights reserved.
6
*
7
* See the COPYING file for the terms of usage and distribution.
8
*/
9
10
#include "
PortabilityImpl.hh
"
11
#ifdef LOG4CPP_HAVE_UNISTD_H
12
# include <unistd.h>
13
#endif
14
#include <sys/types.h>
15
#include <sys/stat.h>
16
#include <fcntl.h>
17
#include <
log4cpp/OstreamAppender.hh
>
18
19
namespace
log4cpp
{
20
21
OstreamAppender::OstreamAppender
(
const
std::string& name, std::ostream* stream) :
22
LayoutAppender
(name),
23
_stream(stream) {
24
}
25
26
OstreamAppender::~OstreamAppender
() {
27
close
();
28
}
29
30
void
OstreamAppender::close
() {
31
// empty
32
}
33
34
void
OstreamAppender::_append
(
const
LoggingEvent
& event) {
35
(*_stream) <<
_getLayout
().
format
(event);
36
if
(!
_stream
->good()) {
37
// XXX help! help!
38
}
39
}
40
41
bool
OstreamAppender::reopen
() {
42
return
true
;
43
}
44
}
log4cpp::OstreamAppender::~OstreamAppender
virtual ~OstreamAppender()
Definition:
OstreamAppender.cpp:26
PortabilityImpl.hh
OstreamAppender.hh
log4cpp::OstreamAppender::_stream
std::ostream * _stream
Definition:
OstreamAppender.hh:34
log4cpp::LayoutAppender::_getLayout
Layout & _getLayout()
Definition:
LayoutAppender.cpp:36
log4cpp
Definition:
AbortAppender.hh:16
log4cpp::OstreamAppender::OstreamAppender
OstreamAppender(const std::string &name, std::ostream *stream)
Definition:
OstreamAppender.cpp:21
log4cpp::OstreamAppender::reopen
virtual bool reopen()
Definition:
OstreamAppender.cpp:41
log4cpp::LoggingEvent
Definition:
LoggingEvent.hh:32
log4cpp::OstreamAppender::_append
virtual void _append(const LoggingEvent &event)
Definition:
OstreamAppender.cpp:34
log4cpp::LayoutAppender
Definition:
LayoutAppender.hh:24
log4cpp::Layout::format
virtual std::string format(const LoggingEvent &event)=0
log4cpp::OstreamAppender::close
virtual void close()
Definition:
OstreamAppender.cpp:30
log4cpp
Author(s): Stephen Roderick, Bastiaan Bakker, Cedric Le Goater, Steve Ostlind, Marcel Harkema, Walter Stroebel, Glenn Scott and Tony Cheung
autogenerated on Sun Jun 23 2019 19:10:00