AnCH Framework 0.2
Another C++ Hack: C++23 utility libraries
Loading...
Searching...
No Matches
anch::log::LoggerFactory Class Reference

Logger factory. More...

#include <loggerFactory.hpp>

Inheritance diagram for anch::log::LoggerFactory:
Collaboration diagram for anch::log::LoggerFactory:

Static Public Member Functions

static const anch::log::Logger & getLogger (std::string_view loggerName)
Static Public Member Functions inherited from anch::Singleton< LoggerFactory >
static LoggerFactory & getInstance ()

Friends

class anch::Singleton< LoggerFactory >

Additional Inherited Members

Public Member Functions inherited from anch::Singleton< LoggerFactory >
Singleton & operator= (const Singleton &)=delete
Protected Member Functions inherited from anch::Singleton< LoggerFactory >
 Singleton () noexcept=default
 ~Singleton ()=default

Detailed Description

Logger factory.

This class aims to manage logger according to the loggers name and configuration.

Since
0.1
Author
Vincent Lachenal

Member Function Documentation

◆ getLogger()

const anch::log::Logger & anch::log::LoggerFactory::getLogger ( std::string_view loggerName)
static

Retrieve a registered logger from a logger name or create a new one and register it.
Thread safe. The returned reference is valid until program exit.
The name is a std::string_view : with a reference parameter, GCC 13 reports a possibly dangling reference (-Wdangling-reference ) when the name is a temporary, as a string literal.

Parameters
loggerNameThe logger name to retrieve
Returns
The loggerr instance

The documentation for this class was generated from the following file: