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