Program Listing for File logger.hpp

Return to documentation for file (include/franka/logging/logger.hpp)

// Copyright (c) 2024 Franka Robotics GmbH
// Use of this source code is governed by the Apache-2.0 license, see LICENSE

#include <fmt/format.h>
#include <memory>

#include <franka/logging/logging_sink_interface.hpp>

namespace franka::logging {

auto addLogger(const std::shared_ptr<LoggingSinkInterface>& logger) -> void;

auto removeLogger(const std::string& logger_name) -> void;

auto removeAllLoggers() -> void;

auto logInfo(const std::string& message) -> void;

template <typename S, typename... Args>
auto logInfo(const S& format_str, Args&&... args) -> void {
  logInfo(fmt::format(format_str, std::forward<Args>(args)...));
}

auto logWarn(const std::string& message) -> void;

template <typename S, typename... Args>
auto logWarn(const S& format_str, Args&&... args) -> void {
  logWarn(fmt::format(format_str, std::forward<Args>(args)...));
}

auto logError(const std::string& message) -> void;

template <typename S, typename... Args>
auto logError(const S& format_str, Args&&... args) -> void {
  logError(fmt::format(format_str, std::forward<Args>(args)...));
}

}  // namespace franka::logging