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 
24  }
25 
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 }
std::auto_ptr< Layout > create_basic_layout(const FactoryParams &params)
Definition: BasicLayout.cpp:40
Priority::Value priority
Definition: LoggingEvent.hh:67
virtual std::string format(const LoggingEvent &event)
Definition: BasicLayout.cpp:29
static const std::string & getPriorityName(int priority)
Definition: Priority.cpp:37


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