Seastar
High performance C++ framework for concurrent servers
Public Member Functions | List of all members
seastar::logger_registry Class Reference

Detailed Description

used to keep a static registry of loggers since the typical use case is to do:

static seastar::logger("my_module");

this class is used to wrap around the static map that holds pointers to all logs

#include <seastar/util/log.hh>

Public Member Functions

void set_all_loggers_level (log_level level)
 
log_level get_logger_level (sstring name) const
 
void set_logger_level (sstring name, log_level level)
 
std::vector< sstring > get_all_logger_names ()
 
void register_logger (logger *l)
 
void unregister_logger (logger *l)
 
void moved (logger *from, logger *to)
 

Member Function Documentation

◆ get_all_logger_names()

std::vector<sstring> seastar::logger_registry::get_all_logger_names ( )

Returns a list of registered loggers Note: this method locks

Returns
all registered loggers

◆ get_logger_level()

log_level seastar::logger_registry::get_logger_level ( sstring  name) const

Given a name for a logger returns the log_level enum Note: this method locks

Returns
log_level for the given logger name

◆ moved()

void seastar::logger_registry::moved ( logger from,
logger to 
)

Swaps the logger given the from->name() in the static map Note: this method locks

◆ register_logger()

void seastar::logger_registry::register_logger ( logger l)

Registers a logger with the static map Note: this method locks

◆ set_all_loggers_level()

void seastar::logger_registry::set_all_loggers_level ( log_level  level)

loops through all registered loggers and sets the log level Note: this method locks

Parameters
level- desired level: error,info,...

◆ set_logger_level()

void seastar::logger_registry::set_logger_level ( sstring  name,
log_level  level 
)

Sets the log level for a given logger Note: this method locks

Parameters
name- name of logger
level- desired level of logging

◆ unregister_logger()

void seastar::logger_registry::unregister_logger ( logger l)

Unregisters a logger with the static map Note: this method locks


The documentation for this class was generated from the following file:
seastar::logger
Logger class for ostream or syslog.
Definition: log.hh:80