AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Namespaces | Classes | Enumerations | Functions
alexaClientSDK::avsCommon::utils::logger Namespace Reference

Namespaces

 test
 

Classes

class  ConsoleLogger
 
class  LogEntry
 LogEntry is used to compile the log entry text to log via Logger. More...
 
class  LogEntryBuffer
 
class  LogEntryStream
 
class  Logger
 
class  LoggerSinkManager
 
class  LogLevelObserverInterface
 
class  LogStringFormatter
 
class  ModuleLogger
 
class  SinkObserverInterface
 
class  TestTrace
 
class  ThreadMoniker
 

Enumerations

enum  Level {
  Level::DEBUG9, Level::DEBUG8, Level::DEBUG7, Level::DEBUG6,
  Level::DEBUG5, Level::DEBUG4, Level::DEBUG3, Level::DEBUG2,
  Level::DEBUG1, Level::DEBUG0, Level::INFO, Level::WARN,
  Level::ERROR, Level::CRITICAL, Level::NONE, Level::UNKNOWN
}
 

Functions

std::shared_ptr< LoggergetConsoleLogger ()
 
std::string convertLevelToName (Level level)
 
char convertLevelToChar (Level level)
 
Level convertNameToLevel (const std::string &name)
 
std::ostream & operator<< (std::ostream &stream, Level level)
 
std::shared_ptr< LoggerACSDK_GET_LOGGER_FUNCTION ()
 
void acsdkDebug9 (const LogEntry &entry)
 
void acsdkDebug8 (const LogEntry &entry)
 
void acsdkDebug7 (const LogEntry &entry)
 
void acsdkDebug6 (const LogEntry &entry)
 
void acsdkDebug5 (const LogEntry &entry)
 
void acsdkDebug4 (const LogEntry &entry)
 
void acsdkDebug3 (const LogEntry &entry)
 
void acsdkDebug2 (const LogEntry &entry)
 
void acsdkDebug1 (const LogEntry &entry)
 
void acsdkDebug0 (const LogEntry &entry)
 
void acsdkDebug (const LogEntry &entry)
 
void acsdkInfo (const LogEntry &entry)
 
void acsdkWarn (const LogEntry &entry)
 
void acsdkError (const LogEntry &entry)
 
void acsdkCritical (const LogEntry &entry)
 
void logEntry (Level level, const LogEntry &entry)
 
void dumpBytesToStream (std::ostream &stream, const char *prefix, size_t width, const unsigned char *data, size_t size)
 
std::shared_ptr< LoggergetLoggerTestLogger ()
 

Enumeration Type Documentation

◆ Level

Enum used to specify the severity assigned to a log message.

Enumerator
DEBUG9 

Most verbose debug log level. Compiled out when ACSDK_DEBUG_LOG_ENABLED is not defined.

DEBUG8 

Intermediate debug log level. Compiled out when ACSDK_DEBUG_LOG_ENABLED is not defined.

DEBUG7 

Intermediate debug log level. Compiled out when ACSDK_DEBUG_LOG_ENABLED is not defined.

DEBUG6 

Intermediate debug log level. Compiled out when ACSDK_DEBUG_LOG_ENABLED is not defined.

DEBUG5 

Intermediate debug log level. Compiled out when ACSDK_DEBUG_LOG_ENABLED is not defined.

DEBUG4 

Intermediate debug log level. Compiled out when ACSDK_DEBUG_LOG_ENABLED is not defined.

DEBUG3 

Intermediate debug log level. Compiled out when ACSDK_DEBUG_LOG_ENABLED is not defined.

DEBUG2 

Intermediate debug log level. Compiled out when ACSDK_DEBUG_LOG_ENABLED is not defined.

DEBUG1 

Intermediate debug log level. Compiled out when ACSDK_DEBUG_LOG_ENABLED is not defined.

DEBUG0 

Least verbose debug log level. Compiled out when ACSDK_DEBUG_LOG_ENABLED is not defined.

INFO 

Logs of normal operations, to be used in release builds.

WARN 

Log of an event that may indicate a problem.

ERROR 

Log of an event that indicates an error.

CRITICAL 

Log of a event that indicates an unrecoverable error.

NONE 

Level used to disable all logging.

UNKNOWN 

An unknown severity level.

Function Documentation

◆ ACSDK_GET_LOGGER_FUNCTION()

std::shared_ptr<Logger> alexaClientSDK::avsCommon::utils::logger::ACSDK_GET_LOGGER_FUNCTION ( )
inline

Inline method to get the logger for the module specified by ACSDK_LOG_MODULE.

◆ acsdkCritical()

void alexaClientSDK::avsCommon::utils::logger::acsdkCritical ( const LogEntry entry)

Log a Level::CRITICAL severity entry.

Parameters
entryA log entry.

◆ acsdkDebug()

void alexaClientSDK::avsCommon::utils::logger::acsdkDebug ( const LogEntry entry)

Log a LEVEL::DEBUG0 severity entry.

Parameters
entryA log entry.

◆ acsdkDebug0()

void alexaClientSDK::avsCommon::utils::logger::acsdkDebug0 ( const LogEntry entry)

Log a LEVEL::DEBUG0 severity entry.

Parameters
entryA log entry.

◆ acsdkDebug1()

void alexaClientSDK::avsCommon::utils::logger::acsdkDebug1 ( const LogEntry entry)

Log a LEVEL::DEBUG1 severity entry.

Parameters
entryA log entry.

◆ acsdkDebug2()

void alexaClientSDK::avsCommon::utils::logger::acsdkDebug2 ( const LogEntry entry)

Log a LEVEL::DEBUG2 severity entry.

Parameters
entryA log entry.

◆ acsdkDebug3()

void alexaClientSDK::avsCommon::utils::logger::acsdkDebug3 ( const LogEntry entry)

Log a LEVEL::DEBUG3 severity entry.

Parameters
entryA log entry.

◆ acsdkDebug4()

void alexaClientSDK::avsCommon::utils::logger::acsdkDebug4 ( const LogEntry entry)

Log a LEVEL::DEBUG4 severity entry.

Parameters
entryA log entry.

◆ acsdkDebug5()

void alexaClientSDK::avsCommon::utils::logger::acsdkDebug5 ( const LogEntry entry)

Log a LEVEL::DEBUG5 severity entry.

Parameters
entryA log entry.

◆ acsdkDebug6()

void alexaClientSDK::avsCommon::utils::logger::acsdkDebug6 ( const LogEntry entry)

Log a LEVEL::DEBUG6 severity entry.

Parameters
entryA log entry.

◆ acsdkDebug7()

void alexaClientSDK::avsCommon::utils::logger::acsdkDebug7 ( const LogEntry entry)

Log a LEVEL::DEBUG7 severity entry.

Parameters
entryA log entry.

◆ acsdkDebug8()

void alexaClientSDK::avsCommon::utils::logger::acsdkDebug8 ( const LogEntry entry)

Log a LEVEL::DEBUG8 severity entry.

Parameters
entryA log entry.

◆ acsdkDebug9()

void alexaClientSDK::avsCommon::utils::logger::acsdkDebug9 ( const LogEntry entry)

Log a LEVEL::DEBUG9 severity entry.

Parameters
entryA log entry.

◆ acsdkError()

void alexaClientSDK::avsCommon::utils::logger::acsdkError ( const LogEntry entry)

Log a Level::ERROR severity entry.

Parameters
entryA log entry.

◆ acsdkInfo()

void alexaClientSDK::avsCommon::utils::logger::acsdkInfo ( const LogEntry entry)

Log a Level::INFO severity entry.

Parameters
entryA log entry.

◆ acsdkWarn()

void alexaClientSDK::avsCommon::utils::logger::acsdkWarn ( const LogEntry entry)

Log a Level::WARN severity entry.

Parameters
entryA log entry.

◆ convertLevelToChar()

char alexaClientSDK::avsCommon::utils::logger::convertLevelToChar ( Level  level)

Get a character corresponding to a Level value. The characters returned are unique per log level and are intended to be used to minimize the space taken up by the level specifier in log lines.

Parameters
levelThe Level for which to get the corresponding character.
Returns
The character corresponding to the level. If the level is not recognized, returns 'U'.

◆ convertLevelToName()

std::string alexaClientSDK::avsCommon::utils::logger::convertLevelToName ( Level  level)

Get the name of a Level value.

Parameters
levelThe Level to get the name of.
Returns
Returns the name of the Level. If the level is not recognized, returns "UNKNOWN".

◆ convertNameToLevel()

Level alexaClientSDK::avsCommon::utils::logger::convertNameToLevel ( const std::string &  name)

Get the Level corresponding to a Level name.

Parameters
nameThe name corresponding to the desired Level value.
Returns
The Level corresponding to the specified name. If the name is not recognized, returns Level::UNKNOWN.

◆ dumpBytesToStream()

void alexaClientSDK::avsCommon::utils::logger::dumpBytesToStream ( std::ostream &  stream,
const char *  prefix,
size_t  width,
const unsigned char *  data,
size_t  size 
)

Stream out an array of bytes as a hex dump.

Parameters
streamThe stream to render to.
prefixA prefix added to each row.
widthThe number of bytes to output per row.
dataThe bytes to render.
sizeThe number of bytes to render.

◆ getConsoleLogger()

std::shared_ptr< Logger > alexaClientSDK::avsCommon::utils::logger::getConsoleLogger ( )

Return the singleton instance of ConsoleLogger.

Returns
The singleton instance of ConsoleLogger.

Get the Logger that logs should be sent to.

Returns
The Logger that logs should be sent to.

◆ getLoggerTestLogger()

std::shared_ptr<Logger> alexaClientSDK::avsCommon::utils::logger::getLoggerTestLogger ( )

Function for ACSDK_* macros to use to get the Logger to use.

Returns
The Logger to use.

◆ logEntry()

void alexaClientSDK::avsCommon::utils::logger::logEntry ( Level  level,
const LogEntry entry 
)

Logs an entry at a severity level using the logger instance defined by ACSDK_GET_LOGGER_FUNCTION (refer to Logger.h).

Parameters
levelThe severity level of the log.
entryA log entry.

◆ operator<<()

std::ostream& alexaClientSDK::avsCommon::utils::logger::operator<< ( std::ostream &  stream,
Level  level 
)
inline

Write a log severity Level value to an ostream as a string.

Parameters
streamThe stream to write the value to.
levelThe Level value to write to the ostream as a string.
Returns
The ostream that was passed in and written to.

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