ROS 2 rclcpp + rcl - rolling  rolling-e7363f10
ROS 2 C++ Client Library with ROS Client Library
log_level.h
Go to the documentation of this file.
1 // Copyright 2020 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__LOG_LEVEL_H_
18 #define RCL__LOG_LEVEL_H_
19 
20 #include <stddef.h>
21 
22 #include "rcl/allocator.h"
23 #include "rcl/macros.h"
24 #include "rcl/types.h"
25 #include "rcl/visibility_control.h"
26 
27 #ifdef __cplusplus
28 extern "C"
29 {
30 #endif
31 
33 typedef enum RCUTILS_LOG_SEVERITY rcl_log_severity_t;
34 
36 typedef struct rcl_logger_setting_s
37 {
39  const char * name;
43 
45 typedef struct rcl_log_levels_s
46 {
58 
60 
71 RCL_PUBLIC
72 RCL_WARN_UNUSED
75 
77 
96 RCL_PUBLIC
97 RCL_WARN_UNUSED
100  rcl_log_levels_t * log_levels, const rcl_allocator_t * allocator, size_t logger_count);
101 
103 
122 RCL_PUBLIC
123 RCL_WARN_UNUSED
124 rcl_ret_t
126 
128 
142 RCL_PUBLIC
143 rcl_ret_t
145 
147 
161 RCL_PUBLIC
162 rcl_ret_t
164 
166 
186 RCL_PUBLIC
187 rcl_ret_t
189  rcl_log_levels_t * log_levels, const char * logger_name, rcl_log_severity_t log_level);
190 
191 #ifdef __cplusplus
192 }
193 #endif
194 
195 #endif // RCL__LOG_LEVEL_H_
rcutils_allocator_t rcl_allocator_t
Encapsulation of an allocator.
Definition: allocator.h:31
RCL_PUBLIC rcl_ret_t rcl_log_levels_fini(rcl_log_levels_t *log_levels)
Reclaim resources held inside rcl_log_levels_t structure.
Definition: log_level.c:108
enum RCUTILS_LOG_SEVERITY rcl_log_severity_t
typedef for RCUTILS_LOG_SEVERITY;
Definition: log_level.h:33
struct rcl_logger_setting_s rcl_logger_setting_t
A logger item to specify a name and a log level.
struct rcl_log_levels_s rcl_log_levels_t
Hold default logger level and other logger setting.
RCL_PUBLIC rcl_ret_t rcl_log_levels_add_logger_setting(rcl_log_levels_t *log_levels, const char *logger_name, rcl_log_severity_t log_level)
Add logger setting with a name and a level.
Definition: log_level.c:151
RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_log_levels_init(rcl_log_levels_t *log_levels, const rcl_allocator_t *allocator, size_t logger_count)
Initialize a log levels structure.
Definition: log_level.c:42
RCL_PUBLIC rcl_ret_t rcl_log_levels_shrink_to_size(rcl_log_levels_t *log_levels)
Shrink log levels structure.
Definition: log_level.c:127
RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_log_levels_copy(const rcl_log_levels_t *src, rcl_log_levels_t *dst)
Copy one log levels structure into another.
Definition: log_level.c:70
RCL_PUBLIC RCL_WARN_UNUSED rcl_log_levels_t rcl_get_zero_initialized_log_levels(void)
Return a rcl_log_levels_t struct with members initialized to zero value.
Definition: log_level.c:29
Hold default logger level and other logger setting.
Definition: log_level.h:46
rcl_allocator_t allocator
Allocator used to allocate objects in this struct.
Definition: log_level.h:56
size_t capacity_logger_settings
Capacity of logger settings.
Definition: log_level.h:54
rcl_logger_setting_t * logger_settings
Array of logger setting.
Definition: log_level.h:50
rcl_log_severity_t default_logger_level
Minimum default logger level severity.
Definition: log_level.h:48
size_t num_logger_settings
Number of logger settings.
Definition: log_level.h:52
A logger item to specify a name and a log level.
Definition: log_level.h:37
rcl_log_severity_t level
Minimum log level severity of the logger.
Definition: log_level.h:41
const char * name
Name for the logger.
Definition: log_level.h:39
rmw_ret_t rcl_ret_t
The type that holds an rcl return code.
Definition: types.h:25