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 
27 void setMinumumLogType(yarp::os::Log::LogType minumumLogType);
28 
29 } // namespace LogComponent
30 } // namespace impl
31 } // namespace os
32 } // namespace yarp
33 
34 #define YARP_OS_LOG_COMPONENT(name, name_string) \
35  const yarp::os::LogComponent& name() \
36  { \
37  static const yarp::os::LogComponent component(name_string, \
38  yarp::os::Log::TraceType, \
39  yarp::os::Log::LogTypeReserved, \
40  yarp::os::impl::LogComponent::print_callback, \
41  nullptr); \
42  return component; \
43  }
44 
45 #define YARP_OS_NON_CONST_LOG_COMPONENT(name, name_string) \
46  yarp::os::LogComponent& name() \
47  { \
48  static yarp::os::LogComponent component(name_string, \
49  yarp::os::Log::TraceType, \
50  yarp::os::Log::LogTypeReserved, \
51  yarp::os::impl::LogComponent::print_callback, \
52  nullptr); \
53  return component; \
54  }
55 
56 #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)
void setMinumumLogType(yarp::os::Log::LogType minumumLogType)
The main, catch-all namespace for YARP.
Definition: dirs.h:16