rcl  master
C API providing common ROS client library functionality.
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 "rcl/allocator.h"
21 #include "rcl/macros.h"
22 #include "rcl/types.h"
23 #include "rcl/visibility_control.h"
24 
25 #ifdef __cplusplus
26 extern "C"
27 {
28 #endif
29 
32 
34 typedef struct rcl_logger_setting_t
35 {
37  const char * name;
41 
43 typedef struct rcl_log_levels_t
44 {
56 
58 
69 RCL_PUBLIC
70 RCL_WARN_UNUSED
73 
75 
94 RCL_PUBLIC
95 RCL_WARN_UNUSED
98  rcl_log_levels_t * log_levels, const rcl_allocator_t * allocator, size_t logger_count);
99 
101 
120 RCL_PUBLIC
121 RCL_WARN_UNUSED
122 rcl_ret_t
124 
126 
140 RCL_PUBLIC
141 rcl_ret_t
143 
145 
159 RCL_PUBLIC
160 rcl_ret_t
162 
164 
184 RCL_PUBLIC
185 rcl_ret_t
187  rcl_log_levels_t * log_levels, const char * logger_name, rcl_log_severity_t log_level);
188 
189 #ifdef __cplusplus
190 }
191 #endif
192 
193 #endif // RCL__LOG_LEVEL_H_
rcl_log_levels_t
struct rcl_log_levels_t rcl_log_levels_t
Hold default logger level and other logger setting.
types.h
rcl_ret_t
rmw_ret_t rcl_ret_t
The type that holds an rcl return code.
Definition: types.h:23
rcl_log_levels_init
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.
RCUTILS_LOG_SEVERITY
RCUTILS_LOG_SEVERITY
rcl_logger_setting_t
A logger item to specify a name and a log level.
Definition: log_level.h:34
rcl_log_levels_t::logger_settings
struct rcl_logger_setting_t * logger_settings
Array of logger setting.
Definition: log_level.h:48
rcl_logger_setting_t::name
const char * name
Name for the logger.
Definition: log_level.h:37
rcl_log_levels_shrink_to_size
rcl_ret_t rcl_log_levels_shrink_to_size(rcl_log_levels_t *log_levels)
Shrink log levels structure.
rcl_log_levels_add_logger_setting
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.
rcl_log_severity_t
enum RCUTILS_LOG_SEVERITY rcl_log_severity_t
typedef for RCUTILS_LOG_SEVERITY;
Definition: log_level.h:31
rcl_log_levels_copy
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.
rcl_get_zero_initialized_log_levels
rcl_log_levels_t rcl_get_zero_initialized_log_levels()
Return a rcl_log_levels_t struct with members initialized to zero value.
rcl_logger_setting_t::level
rcl_log_severity_t level
Minimum log level severity of the logger.
Definition: log_level.h:39
rcl_log_levels_t::default_logger_level
rcl_log_severity_t default_logger_level
Minimum default logger level severity.
Definition: log_level.h:46
rcutils_allocator_t
allocator.h
rcl_log_levels_t
Hold default logger level and other logger setting.
Definition: log_level.h:43
rcl_log_levels_t::allocator
rcl_allocator_t allocator
Allocator used to allocate objects in this struct.
Definition: log_level.h:54
rcl_log_levels_fini
rcl_ret_t rcl_log_levels_fini(rcl_log_levels_t *log_levels)
Reclaim resources held inside rcl_log_levels_t structure.
rcl_log_levels_t::capacity_logger_settings
size_t capacity_logger_settings
Capacity of logger settings.
Definition: log_level.h:52
rcl_log_levels_t::num_logger_settings
size_t num_logger_settings
Number of logger settings.
Definition: log_level.h:50
rcl_logger_setting_t
struct rcl_logger_setting_t rcl_logger_setting_t
A logger item to specify a name and a log level.