AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | Protected Attributes | List of all members
alexaClientSDK::avsCommon::utils::logger::ModuleLogger Class Reference

#include <ModuleLogger.h>

Inheritance diagram for alexaClientSDK::avsCommon::utils::logger::ModuleLogger:
Inheritance graph
Collaboration diagram for alexaClientSDK::avsCommon::utils::logger::ModuleLogger:
Collaboration graph

Public Member Functions

 ModuleLogger (const std::string &configKey)
void setLevel (Level level) override
void emit (Level level, std::chrono::system_clock::time_point time, const char *threadId, const char *text) override
- Public Member Functions inherited from alexaClientSDK::avsCommon::utils::logger::Logger
 Logger (Level level)
virtual ~Logger ()=default
 Destructor. More...
bool shouldLog (Level level) const
void log (Level level, const LogEntry &entry)
void logAtExit (Level level, const LogEntry &entry)
void addLogLevelObserver (LogLevelObserverInterface *observer)
void removeLogLevelObserver (LogLevelObserverInterface *observer)

Protected Attributes

std::shared_ptr< Loggerm_sink
 The Logger to forward logs to. More...
- Protected Attributes inherited from alexaClientSDK::avsCommon::utils::logger::Logger
std::atomic< Levelm_level
 The lowest severity level of logs to be output by this Logger. More...

Additional Inherited Members

- Protected Member Functions inherited from alexaClientSDK::avsCommon::utils::logger::Logger
void init (const configuration::ConfigurationNode configuration)
- Protected Member Functions inherited from alexaClientSDK::avsCommon::utils::logger::LogLevelObserverInterface
virtual ~LogLevelObserverInterface ()=default
- Protected Member Functions inherited from alexaClientSDK::avsCommon::utils::logger::SinkObserverInterface
virtual ~SinkObserverInterface ()=default

Detailed Description

Logger implementation providing per module configuration. Forwards logs to another Logger.

Constructor & Destructor Documentation

◆ ModuleLogger()

alexaClientSDK::avsCommon::utils::logger::ModuleLogger::ModuleLogger ( const std::string &  configKey)


configKeyThe name of the root configuration key to inspect for a "logLevel" string value. That string is used to specify the lowest log severity level that this ModuleLogger should emit.

Member Function Documentation

◆ emit()

void alexaClientSDK::avsCommon::utils::logger::ModuleLogger::emit ( Level  level,
std::chrono::system_clock::time_point  time,
const char *  threadMoniker,
const char *  text 

Emit a log entry. Default implementation is no-op. NOTE: This method must be thread-safe. NOTE: Delays in returning from this method may hold up calls to Logger::log().

[in]levelThe severity Level of this log line.
[in]timeThe time that the event to log occurred.
[in]threadMonikerMoniker of the thread that generated the event.
[in]textThe text of the entry to log.

Reimplemented from alexaClientSDK::avsCommon::utils::logger::Logger.

◆ setLevel()

void alexaClientSDK::avsCommon::utils::logger::ModuleLogger::setLevel ( Level  level)

Set the lowest severity level to be output by this logger.

levelThe lowest severity level to be output by this logger.

Reimplemented from alexaClientSDK::avsCommon::utils::logger::Logger.

Member Data Documentation

◆ m_sink

std::shared_ptr<Logger> alexaClientSDK::avsCommon::utils::logger::ModuleLogger::m_sink

The Logger to forward logs to.

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

AlexaClientSDK 3.0.0 - Copyright 2016-2022, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0