Program Listing for File log_level.h

Return to documentation for file (include/rcl/log_level.h)

// Copyright 2020 Open Source Robotics Foundation, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.


#ifndef RCL__LOG_LEVEL_H_
#define RCL__LOG_LEVEL_H_

#include "rcl/allocator.h"
#include "rcl/macros.h"
#include "rcl/types.h"
#include "rcl/visibility_control.h"

#ifdef __cplusplus
extern "C"
{
#endif

typedef enum RCUTILS_LOG_SEVERITY rcl_log_severity_t;

typedef struct rcl_logger_setting_s
{
  const char * name;
  rcl_log_severity_t level;
} rcl_logger_setting_t;

typedef struct rcl_log_levels_s
{
  rcl_log_severity_t default_logger_level;
  rcl_logger_setting_t * logger_settings;
  size_t num_logger_settings;
  size_t capacity_logger_settings;
  rcl_allocator_t allocator;
} rcl_log_levels_t;


RCL_PUBLIC
RCL_WARN_UNUSED
rcl_log_levels_t
rcl_get_zero_initialized_log_levels();


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);


RCL_PUBLIC
RCL_WARN_UNUSED
rcl_ret_t
rcl_log_levels_copy(const rcl_log_levels_t * src, rcl_log_levels_t * dst);


RCL_PUBLIC
rcl_ret_t
rcl_log_levels_fini(rcl_log_levels_t * log_levels);


RCL_PUBLIC
rcl_ret_t
rcl_log_levels_shrink_to_size(rcl_log_levels_t * log_levels);


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);

#ifdef __cplusplus
}
#endif

#endif  // RCL__LOG_LEVEL_H_