AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Namespaces | Macros | Functions
Logger.h File Reference
#include <atomic>
#include <chrono>
#include <mutex>
#include <sstream>
#include <vector>
#include <AVSCommon/Utils/Configuration/ConfigurationNode.h>
#include "AVSCommon/Utils/Logger/Level.h"
#include "AVSCommon/Utils/Logger/LogEntry.h"
#include "AVSCommon/Utils/Logger/LogLevelObserverInterface.h"
#include "AVSCommon/Utils/Logger/SinkObserverInterface.h"
#include "AVSCommon/Utils/Logger/ModuleLogger.h"
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.

Classes

class  alexaClientSDK::avsCommon::utils::logger::Logger
 

Namespaces

 alexaClientSDK
 Whether or not curl logs should be emitted.
 
 alexaClientSDK::avsCommon
 
 alexaClientSDK::avsCommon::utils
 
 alexaClientSDK::avsCommon::utils::logger
 

Macros

#define ACSDK_STRINGIFY_INNER(expression)   #expression
 
#define ACSDK_STRINGIFY(macro)   ACSDK_STRINGIFY_INNER(macro)
 
#define ACSDK_CONCATENATE_INNER(lhs, rhs)   lhs##rhs
 
#define ACSDK_CONCATENATE(lhs, rhs)   ACSDK_CONCATENATE_INNER(lhs, rhs)
 
#define ACSDK_GET_LOGGER_FUNCTION_NAME(type)   ACSDK_CONCATENATE(ACSDK_CONCATENATE(get, type), Logger)
 
#define ACSDK_LOG_MODULE   ConsoleLogger
 
#define ACSDK_GET_LOGGER_FUNCTION   ACSDK_GET_LOGGER_FUNCTION_NAME(ACSDK_LOG_MODULE)
 
#define ACSDK_LOG(level, entry)
 Common implementation for sending entries to the log. More...
 
#define ACSDK_DEBUG_LOG(level, entry)
 Common implementation for sending debug entries to the log. More...
 
#define ACSDK_DEBUG9(entry)   ACSDK_DEBUG_LOG(alexaClientSDK::avsCommon::utils::logger::Level::DEBUG9, entry)
 
#define ACSDK_DEBUG8(entry)   ACSDK_DEBUG_LOG(alexaClientSDK::avsCommon::utils::logger::Level::DEBUG8, entry)
 
#define ACSDK_DEBUG7(entry)   ACSDK_DEBUG_LOG(alexaClientSDK::avsCommon::utils::logger::Level::DEBUG7, entry)
 
#define ACSDK_DEBUG6(entry)   ACSDK_DEBUG_LOG(alexaClientSDK::avsCommon::utils::logger::Level::DEBUG6, entry)
 
#define ACSDK_DEBUG5(entry)   ACSDK_DEBUG_LOG(alexaClientSDK::avsCommon::utils::logger::Level::DEBUG5, entry)
 
#define ACSDK_DEBUG4(entry)   ACSDK_DEBUG_LOG(alexaClientSDK::avsCommon::utils::logger::Level::DEBUG4, entry)
 
#define ACSDK_DEBUG3(entry)   ACSDK_DEBUG_LOG(alexaClientSDK::avsCommon::utils::logger::Level::DEBUG3, entry)
 
#define ACSDK_DEBUG2(entry)   ACSDK_DEBUG_LOG(alexaClientSDK::avsCommon::utils::logger::Level::DEBUG2, entry)
 
#define ACSDK_DEBUG1(entry)   ACSDK_DEBUG_LOG(alexaClientSDK::avsCommon::utils::logger::Level::DEBUG1, entry)
 
#define ACSDK_DEBUG0(entry)   ACSDK_DEBUG_LOG(alexaClientSDK::avsCommon::utils::logger::Level::DEBUG0, entry)
 
#define ACSDK_DEBUG(entry)   ACSDK_DEBUG_LOG(alexaClientSDK::avsCommon::utils::logger::Level::DEBUG0, entry)
 
#define ACSDK_INFO(entry)   ACSDK_LOG(alexaClientSDK::avsCommon::utils::logger::Level::INFO, entry)
 
#define ACSDK_WARN(entry)   ACSDK_LOG(alexaClientSDK::avsCommon::utils::logger::Level::WARN, entry)
 
#define ACSDK_ERROR(entry)   ACSDK_LOG(alexaClientSDK::avsCommon::utils::logger::Level::ERROR, entry)
 
#define ACSDK_CRITICAL(entry)   ACSDK_LOG(alexaClientSDK::avsCommon::utils::logger::Level::CRITICAL, entry)
 

Functions

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

Macro Definition Documentation

◆ ACSDK_CONCATENATE

#define ACSDK_CONCATENATE (   lhs,
  rhs 
)    ACSDK_CONCATENATE_INNER(lhs, rhs)

Concatenate two macros in to a token.

Parameters
lhsThe macro to turn in to the left hand part of the token.
rhsThe macro to turn in to the right hand part of the token.

◆ ACSDK_CONCATENATE_INNER

#define ACSDK_CONCATENATE_INNER (   lhs,
  rhs 
)    lhs##rhs

Inner part of ACSDK_CONCATENATE. Concatenate two expressions in to a token.

Parameters
lhsThe expression to turn in to the left hand part of the token.
rhsThe expression to turn in to the right hand part of the token.

◆ ACSDK_CRITICAL

#define ACSDK_CRITICAL (   entry)    ACSDK_LOG(alexaClientSDK::avsCommon::utils::logger::Level::CRITICAL, entry)

Send a CRITICAL severity log line.

Note
If ACSDK_LOG_ENABLED is set to OFF, then logging is disabled.
Parameters
[in]entryA constructed LogEntry object with the log message text.

◆ ACSDK_DEBUG

#define ACSDK_DEBUG (   entry)    ACSDK_DEBUG_LOG(alexaClientSDK::avsCommon::utils::logger::Level::DEBUG0, entry)

Send a log line at the default debug level (DEBUG0).

Note
If ACSDK_DEBUG_LOG_ENABLED is set to OFF, then logging is disabled.
Parameters
[in]entryA constructed LogEntry object with the log message text.

◆ ACSDK_DEBUG0

#define ACSDK_DEBUG0 (   entry)    ACSDK_DEBUG_LOG(alexaClientSDK::avsCommon::utils::logger::Level::DEBUG0, entry)

Send a DEBUG0 severity log line.

Note
If ACSDK_DEBUG_LOG_ENABLED is set to OFF, then logging is disabled.
Parameters
[in]entryA constructed LogEntry object with the log message text.

◆ ACSDK_DEBUG1

#define ACSDK_DEBUG1 (   entry)    ACSDK_DEBUG_LOG(alexaClientSDK::avsCommon::utils::logger::Level::DEBUG1, entry)

Send a DEBUG1 severity log line.

Note
If ACSDK_DEBUG_LOG_ENABLED is set to OFF, then logging is disabled.
Parameters
[in]entryA constructed LogEntry object with the log message text.

◆ ACSDK_DEBUG2

#define ACSDK_DEBUG2 (   entry)    ACSDK_DEBUG_LOG(alexaClientSDK::avsCommon::utils::logger::Level::DEBUG2, entry)

Send a DEBUG2 severity log line.

Note
If ACSDK_DEBUG_LOG_ENABLED is set to OFF, then logging is disabled.
Parameters
[in]entryA constructed LogEntry object with the log message text.

◆ ACSDK_DEBUG3

#define ACSDK_DEBUG3 (   entry)    ACSDK_DEBUG_LOG(alexaClientSDK::avsCommon::utils::logger::Level::DEBUG3, entry)

Send a DEBUG3 severity log line.

Note
If ACSDK_DEBUG_LOG_ENABLED is set to OFF, then logging is disabled.
Parameters
[in]entryA constructed LogEntry object with the log message text.

◆ ACSDK_DEBUG4

#define ACSDK_DEBUG4 (   entry)    ACSDK_DEBUG_LOG(alexaClientSDK::avsCommon::utils::logger::Level::DEBUG4, entry)

Send a DEBUG4 severity log line.

Note
If ACSDK_DEBUG_LOG_ENABLED is set to OFF, then logging is disabled.
Parameters
[in]entryA constructed LogEntry object with the log message text.

◆ ACSDK_DEBUG5

#define ACSDK_DEBUG5 (   entry)    ACSDK_DEBUG_LOG(alexaClientSDK::avsCommon::utils::logger::Level::DEBUG5, entry)

Send a DEBUG5 severity log line.

Note
If ACSDK_DEBUG_LOG_ENABLED is set to OFF, then logging is disabled.
Parameters
[in]entryA constructed LogEntry object with the log message text.

◆ ACSDK_DEBUG6

#define ACSDK_DEBUG6 (   entry)    ACSDK_DEBUG_LOG(alexaClientSDK::avsCommon::utils::logger::Level::DEBUG6, entry)

Send a DEBUG6 severity log line.

Note
If ACSDK_DEBUG_LOG_ENABLED is set to OFF, then logging is disabled.
Parameters
[in]entryA constructed LogEntry object with the log message text.

◆ ACSDK_DEBUG7

#define ACSDK_DEBUG7 (   entry)    ACSDK_DEBUG_LOG(alexaClientSDK::avsCommon::utils::logger::Level::DEBUG7, entry)

Send a DEBUG7 severity log line.

Note
If ACSDK_DEBUG_LOG_ENABLED is set to OFF, then logging is disabled.
Parameters
[in]entryA constructed LogEntry object with the log message text.

◆ ACSDK_DEBUG8

#define ACSDK_DEBUG8 (   entry)    ACSDK_DEBUG_LOG(alexaClientSDK::avsCommon::utils::logger::Level::DEBUG8, entry)

Send a DEBUG8 severity log line.

Note
If ACSDK_DEBUG_LOG_ENABLED is set to OFF, then logging is disabled.
Parameters
[in]entryA constructed LogEntry object with the log message text.

◆ ACSDK_DEBUG9

#define ACSDK_DEBUG9 (   entry)    ACSDK_DEBUG_LOG(alexaClientSDK::avsCommon::utils::logger::Level::DEBUG9, entry)

Send a DEBUG9 severity log line.

Note
If ACSDK_DEBUG_LOG_ENABLED is set to OFF, then logging is disabled.
Parameters
[in]entryA constructed LogEntry object with the log message text.

◆ ACSDK_DEBUG_LOG

#define ACSDK_DEBUG_LOG (   level,
  entry 
)
Value:
do { \
(void)sizeof(level); \
(void)sizeof(entry); \
} while (false)

Common implementation for sending debug entries to the log.

Note
If ACSDK_DEBUG_LOG_ENABLED is set to OFF, then logging is disabled.
Parameters
[in]levelThe log level to associate with the log line.
[in]entryA constructed LogEntry object with the log message text.

◆ ACSDK_ERROR

#define ACSDK_ERROR (   entry)    ACSDK_LOG(alexaClientSDK::avsCommon::utils::logger::Level::ERROR, entry)

Send a ERROR severity log line.

Note
If ACSDK_LOG_ENABLED is set to OFF, then logging is disabled.
Parameters
[in]entryA constructed LogEntry object with the log message text.

◆ ACSDK_GET_LOGGER_FUNCTION

#define ACSDK_GET_LOGGER_FUNCTION   ACSDK_GET_LOGGER_FUNCTION_NAME(ACSDK_LOG_MODULE)

Macro to define the function that ACSDK_<LEVEL> macros will send logs to. In this case ACSDK_LOG_MODULE was defined and logs will be sent to the Logger returned by get<ACSDK_LOG_MODULE>Logger().

◆ ACSDK_GET_LOGGER_FUNCTION_NAME

#define ACSDK_GET_LOGGER_FUNCTION_NAME (   type)    ACSDK_CONCATENATE(ACSDK_CONCATENATE(get, type), Logger)

Macro for building function name of the form get<type>Logger().

Parameters
typeThe type of Logger for which to build a get<type>Logger() function name.

◆ ACSDK_INFO

#define ACSDK_INFO (   entry)    ACSDK_LOG(alexaClientSDK::avsCommon::utils::logger::Level::INFO, entry)

Send a INFO severity log line.

Note
If ACSDK_LOG_ENABLED is set to OFF, then logging is disabled.
Parameters
[in]entryA constructed LogEntry object with the log message text.

◆ ACSDK_LOG

#define ACSDK_LOG (   level,
  entry 
)
Value:
do { \
(void)sizeof(level); \
(void)sizeof(entry); \
} while (false)

Common implementation for sending entries to the log.

Note
If ACSDK_LOG_ENABLED is set to OFF, then logging is disabled.
Parameters
[in]levelThe log level to associate with the log line.
[in]entryA constructed LogEntry object with the log message text.

◆ ACSDK_LOG_MODULE

#define ACSDK_LOG_MODULE   ConsoleLogger

◆ ACSDK_STRINGIFY

#define ACSDK_STRINGIFY (   macro)    ACSDK_STRINGIFY_INNER(macro)

Turn a macro in to a string literal.

Parameters
macroThe macro to expand and turn in to a string literal.

◆ ACSDK_STRINGIFY_INNER

#define ACSDK_STRINGIFY_INNER (   expression)    #expression

Inner part of ACSDK_STRINGIFY. Turns an expression in to a string literal.

Parameters
expressionThe expression to turn in to a string literal.

◆ ACSDK_WARN

#define ACSDK_WARN (   entry)    ACSDK_LOG(alexaClientSDK::avsCommon::utils::logger::Level::WARN, entry)

Send a WARN severity log line.

Note
If ACSDK_LOG_ENABLED is set to OFF, then logging is disabled.
Parameters
[in]entryA constructed LogEntry object with the log message text.

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