Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
src
BasicLayout.cpp
Go to the documentation of this file.
1
/*
2
* BasicLayout.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
#include <
log4cpp/BasicLayout.hh
>
12
#include <
log4cpp/Priority.hh
>
13
#include <
log4cpp/FactoryParams.hh
>
14
#include <memory>
15
16
#ifdef LOG4CPP_HAVE_SSTREAM
17
#include <sstream>
18
#endif
19
#include <memory>
20
21
namespace
log4cpp
{
22
23
BasicLayout::BasicLayout
() {
24
}
25
26
BasicLayout::~BasicLayout
() {
27
}
28
29
std::string
BasicLayout::format
(
const
LoggingEvent
& event) {
30
std::ostringstream
message;
31
32
const
std::string& priorityName =
Priority::getPriorityName
(event.
priority
);
33
message <<
event
.timeStamp.getSeconds() <<
" "
<< priorityName <<
" "
34
<<
event
.categoryName <<
" "
<<
event
.ndc <<
": "
35
<<
event
.message << std::endl;
36
37
return
message.
str
();
38
}
39
40
std::auto_ptr<Layout>
create_basic_layout
(
const
FactoryParams
& params)
41
{
42
return
std::auto_ptr<Layout>(
new
BasicLayout
);
43
}
44
}
log4cpp::create_basic_layout
std::auto_ptr< Layout > create_basic_layout(const FactoryParams ¶ms)
Definition:
BasicLayout.cpp:40
FactoryParams.hh
PortabilityImpl.hh
std::ostringstream::str
std::string str()
Definition:
PortabilityImpl.cpp:19
log4cpp::LoggingEvent::priority
Priority::Value priority
Definition:
LoggingEvent.hh:67
log4cpp::FactoryParams
Definition:
FactoryParams.hh:61
log4cpp
Definition:
AbortAppender.hh:16
log4cpp::LoggingEvent
Definition:
LoggingEvent.hh:32
log4cpp::BasicLayout::format
virtual std::string format(const LoggingEvent &event)
Definition:
BasicLayout.cpp:29
BasicLayout.hh
log4cpp::BasicLayout::BasicLayout
BasicLayout()
Definition:
BasicLayout.cpp:23
std::ostringstream
Definition:
Portability.hh:45
log4cpp::Priority::getPriorityName
static const std::string & getPriorityName(int priority)
Definition:
Priority.cpp:37
log4cpp::BasicLayout::~BasicLayout
virtual ~BasicLayout()
Definition:
BasicLayout.cpp:26
Priority.hh
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:14:17