TestLoggingAvailability.cpp
Go to the documentation of this file.
2 #include <rtt/rt_string.hpp>
3 #include "logging/Category.hpp"
4 
5 #include <rtt/Logger.hpp>
6 #include "ocl/Component.hpp"
7 
9 
10 namespace OCL {
11 namespace logging {
12 namespace test {
13 
14 static const char* categoryName = "org.orocos.ocl.logging.tests";
15 
17  RTT::TaskContext(name),
18  logger(dynamic_cast<OCL::logging::Category*>(
19  &log4cpp::Category::getInstance(
20  categoryName + std::string(".") + name)))
21 {
22 }
23 
25 {
26 }
27 
29 {
30  if (logger)
31  {
32  logger->info(RTT::rt_string("Available in configureHook"));
33  }
34  else
35  {
36  log(Error) << "Not available in configureHook()" << endlog();
37  }
38  return true;
39 }
40 
42 {
43  if (logger)
44  {
45  logger->info(RTT::rt_string("Available in startHook"));
46  }
47  else
48  {
49  log(Error) << "Not available in startHook()" << endlog();
50  }
51  return true;
52 }
53 
55 {
56  if (logger)
57  {
58  logger->info(RTT::rt_string("Available in updateHook"));
59  }
60  else
61  {
62  log(Error) << "Not available in updateHook()" << endlog();
63  }
64 }
65 
67 {
68  if (logger)
69  {
70  logger->info(RTT::rt_string("Available in stopHook"));
71  }
72  else
73  {
74  log(Error) << "Not available in stopHook()" << endlog();
75  }
76 }
77 
78 // namespaces
79 }
80 }
81 }
82 
83 //ORO_CREATE_COMPONENT_TYPE();
std::basic_string< char, std::char_traits< char >, RTT::os::rt_allocator< char > > rt_string
void test(std::string pattern, log4cpp::PatternLayout *layout, log4cpp::Category &cat)
void info(const RTT::rt_string &message)
Definition: Category.cpp:39
static const char * categoryName
ORO_LIST_COMPONENT_TYPE(OCL::logging::test::LoggingAvailability)
Error


ocl
Author(s): OCL Development Team
autogenerated on Wed Jun 26 2019 19:26:27