Skip to content
Snippets Groups Projects
  1. Feb 06, 2024
    • Henri Chataing's avatar
      system: fmtlib logger implementation · e08cbed3
      Henri Chataing authored
      - The fmtlib logger is implemented in <bluetooth/log.h>.
        The header defines the following templated logs function:
      
          template<typename T...>
          log::fatal(fmt::format_string<T...> fmt, T...args);
          log::error(..);
          log::warn(..);
          log::info(..);
          log::debug(..);
          log::verbose(..);
      
      - Front-end, logs are printed out by invoking these
        macros with the macro LOG_TAG defined _before_ the
        inclusion of #include <bluetooth/log.h>
      
      - Back-end, a single method must be implemented for all supported
        platforms (android, floss, host):
      
        namespace log_internal {
        void vlog(Level level, char const *tag, char const *file_name, int line,
                  fmt::string_view fmt, fmt::format_args vargs);
        }
      
      - Default implementations are provided:
        + vlog_android: outputs to <log/log.h> __android_log_write_log_message
        + vlog_syslog: outputs to <syslog.h> syslog
      
      Bug: 305066880
      Test: m libbluetooth_log
      Test: atest libbluetooth_log_test
      Flag: EXEMPT, logging utils
      Change-Id: Ic8a80f113b25d874c372d7dce8252d5428842ee8
      e08cbed3
  2. Feb 02, 2024
  3. Feb 01, 2024
Loading