rcl  master
C API providing common ROS client library functionality.
logging.h
Go to the documentation of this file.
1 // Copyright 2018 Open Source Robotics Foundation, Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
16 
17 #ifndef RCL__LOGGING_H_
18 #define RCL__LOGGING_H_
19 
20 #include "rcl/allocator.h"
21 #include "rcl/arguments.h"
22 #include "rcl/macros.h"
23 #include "rcl/types.h"
24 #include "rcl/visibility_control.h"
25 
26 #include "rcutils/logging.h"
27 
28 #ifdef __cplusplus
29 extern "C"
30 {
31 #endif
32 
35 
37 
56 RCL_PUBLIC
57 RCL_WARN_UNUSED
60  const rcl_arguments_t * global_args,
61  const rcl_allocator_t * allocator);
62 
64 
84 RCL_PUBLIC
85 RCL_WARN_UNUSED
88  const rcl_arguments_t * global_args,
89  const rcl_allocator_t * allocator,
90  rcl_logging_output_handler_t output_handler);
91 
106 RCL_PUBLIC
107 RCL_WARN_UNUSED
109 
111 
125 RCL_PUBLIC
126 RCL_WARN_UNUSED
127 bool rcl_logging_rosout_enabled(void);
128 
130 
151 RCL_PUBLIC
152 void
154  const rcutils_log_location_t * location,
155  int severity, const char * name, rcutils_time_point_value_t timestamp,
156  const char * format, va_list * args);
157 
158 #ifdef __cplusplus
159 }
160 #endif
161 
162 #endif // RCL__LOGGING_H_
rcl_logging_output_handler_t
rcutils_logging_output_handler_t rcl_logging_output_handler_t
The function signature to log messages.
Definition: logging.h:34
rcl_logging_fini
rcl_ret_t rcl_logging_fini(void)
types.h
rcl_ret_t
rmw_ret_t rcl_ret_t
The type that holds an rcl return code.
Definition: types.h:23
rcl_logging_configure_with_output_handler
rcl_ret_t rcl_logging_configure_with_output_handler(const rcl_arguments_t *global_args, const rcl_allocator_t *allocator, rcl_logging_output_handler_t output_handler)
Configure the logging system with the provided output handler.
rcl_logging_rosout_enabled
bool rcl_logging_rosout_enabled(void)
See if logging rosout is enabled.
rcutils_logging_output_handler_t
void(* rcutils_logging_output_handler_t)(const rcutils_log_location_t *, int, const char *, rcutils_time_point_value_t, const char *, va_list *)
rcl_logger_setting_t::name
const char * name
Name for the logger.
Definition: log_level.h:37
rcl_arguments_t
Hold output of parsing command line arguments.
Definition: arguments.h:35
arguments.h
rcl_logging_multiple_output_handler
void rcl_logging_multiple_output_handler(const rcutils_log_location_t *location, int severity, const char *name, rcutils_time_point_value_t timestamp, const char *format, va_list *args)
Default output handler used by rcl.
rcutils_time_point_value_t
int64_t rcutils_time_point_value_t
rcutils_log_location_t
rcutils_allocator_t
allocator.h
va_list
logging.h
rcl_logging_configure
rcl_ret_t rcl_logging_configure(const rcl_arguments_t *global_args, const rcl_allocator_t *allocator)
Configure the logging system.