YARP
Yet Another Robot Platform
LogComponent.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 
6 #ifndef YARP_OS_IMPL_LOGCOMPONENT_H
7 #define YARP_OS_IMPL_LOGCOMPONENT_H
8 
9 #include <yarp/os/api.h>
10 #include <yarp/os/LogComponent.h>
11 
12 namespace yarp {
13 namespace os {
14 namespace impl {
15 namespace LogComponent {
16 
18  const char* msg,
19  const char* file,
20  const unsigned int line,
21  const char* func,
22  double systemtime,
23  double networktime,
24  double externaltime,
25  const char* comp_name);
26 
28 void setMinumumLogType(yarp::os::Log::LogType minumumLogType);
29 
30 } // namespace LogComponent
31 } // namespace impl
32 } // namespace os
33 } // namespace yarp
34 
35 #define YARP_OS_LOG_COMPONENT(name, name_string) \
36  const yarp::os::LogComponent& name() \
37  { \
38  static const yarp::os::LogComponent component(name_string, \
39  yarp::os::impl::LogComponent::minimumLogType(), \
40  yarp::os::Log::LogTypeReserved, \
41  yarp::os::Log::defaultPrintCallback(), \
42  nullptr); \
43  return component; \
44  }
45 
46 #define YARP_OS_NON_CONST_LOG_COMPONENT(name, name_string) \
47  yarp::os::LogComponent& name() \
48  { \
49  static yarp::os::LogComponent component(name_string, \
50  yarp::os::impl::LogComponent::minimumLogType(), \
51  yarp::os::Log::LogTypeReserved, \
52  yarp::os::Log::defaultPrintCallback(), \
53  nullptr); \
54  return component; \
55  }
56 
57 #endif // YARP_OS_IMPL_LOGCOMPONENT_H
void print_callback(yarp::os::Log::LogType type, const char *msg, const char *file, const unsigned int line, const char *func, double systemtime, double networktime, double externaltime, const char *comp_name)
yarp::os::Log::LogType minimumLogType()
void setMinumumLogType(yarp::os::Log::LogType minumumLogType)
The main, catch-all namespace for YARP.
Definition: dirs.h:16