Common System 0.2.0
Common interfaces and patterns for system integration
Loading...
Searching...
No Matches
logger.h File Reference

C++20 concepts for logger interfaces. More...

#include <concepts>
#include <string>
#include <string_view>
#include <type_traits>
Include dependency graph for logger.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  kcenon
 
namespace  kcenon::common
 Core interfaces.
 
namespace  kcenon::common::interfaces
 
namespace  kcenon::common::concepts
 C++20 concepts for compile-time type validation.
 

Concepts

concept  kcenon::common::concepts::LogLevelEnumLike
 A type that represents log levels.
 
concept  kcenon::common::concepts::BasicLogger
 A type that provides basic logging functionality.
 
concept  kcenon::common::concepts::LevelAwareLogger
 A type that supports log level filtering.
 
concept  kcenon::common::concepts::FlushableLogger
 A type that supports flushing buffered log messages.
 
concept  kcenon::common::concepts::StructuredLogger
 A type that supports structured log entries.
 
concept  kcenon::common::concepts::LoggerLike
 A complete logger type satisfying ILogger interface requirements.
 
concept  kcenon::common::concepts::LoggerProviderLike
 A type that can provide logger instances.
 
concept  kcenon::common::concepts::LoggerRegistryLike
 A type that manages named logger instances.
 

Detailed Description

C++20 concepts for logger interfaces.

This header provides concepts for validating logger types used in logging operations. These concepts replace abstract class-based constraints with compile-time validation and clearer error messages.

Requirements:

  • C++20 compiler with concepts support
  • GCC 10+, Clang 10+, MSVC 2022+

Thread Safety:

  • Concepts are evaluated at compile-time only.
  • No runtime thread-safety considerations apply.
See also
logger_interface.h for ILogger definition
https://en.cppreference.com/w/cpp/language/constraints

Definition in file logger.h.