AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Namespaces | Macros | Functions | Variables
LoggerTest.cpp File Reference
#include <thread>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "AVSCommon/Utils/Logger/Logger.h"
#include "AVSCommon/Utils/Logger/LoggerSinkManager.h"
Include dependency graph for LoggerTest.cpp:

Classes

class  alexaClientSDK::avsCommon::utils::logger::test::MockLogger
 
class  alexaClientSDK::avsCommon::utils::logger::test::MockModuleLogger
 
class  alexaClientSDK::avsCommon::utils::logger::test::TestLogger
 
class  alexaClientSDK::avsCommon::utils::logger::test::LoggerTest
 

Namespaces

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

Macros

#define LX(event)   LogEntry(TEST_SOURCE_STRING, event)
 Macro used to initial creation of log entries for this source. More...
 
#define METADATA_KEY   "metadata_key"
 String used to verify passing metadata keys. More...
 
#define METADATA_KEY_TRUE   "key_true"
 Key for boolean true metadata value. More...
 
#define METADATA_KEY_FALSE   "key_false"
 Key for boolean false metadata value. More...
 
#define KEY_VALUE_SEPARATOR   "="
 Constant string used to separate (and connect) keys and values. More...
 
#define KEY_VALUE_PAIR_SEPARATOR   ","
 Constant string used to separate key,value pairs from each other. More...
 
#define ESCAPED_METADATA_VALUE   R"(reserved_chars['\\' '\,' '\:' '\='])"
 Escaped version of UNESCAPED_METADATA_VALUE, used to verify proper escaping of metadata values. More...
 
#define METADATA_EXPECTED_BOOLEANS
 Expected output string for test of boolean metadata. More...
 
#define DEBUG_COUNT   0
 
#define LOG_COUNT   0
 

Functions

std::shared_ptr< Logger > alexaClientSDK::avsCommon::utils::logger::getLoggerTestLogger ()
 
 alexaClientSDK::avsCommon::utils::logger::test::TEST_F (LoggerTest, test_logDebug9Level)
 
 alexaClientSDK::avsCommon::utils::logger::test::TEST_F (LoggerTest, test_logDebug8Level)
 
 alexaClientSDK::avsCommon::utils::logger::test::TEST_F (LoggerTest, test_logDebug7Level)
 
 alexaClientSDK::avsCommon::utils::logger::test::TEST_F (LoggerTest, test_logDebug6Level)
 
 alexaClientSDK::avsCommon::utils::logger::test::TEST_F (LoggerTest, test_logDebug5Level)
 
 alexaClientSDK::avsCommon::utils::logger::test::TEST_F (LoggerTest, test_logDebug4Level)
 
 alexaClientSDK::avsCommon::utils::logger::test::TEST_F (LoggerTest, test_logDebug3Level)
 
 alexaClientSDK::avsCommon::utils::logger::test::TEST_F (LoggerTest, test_logDebug2Level)
 
 alexaClientSDK::avsCommon::utils::logger::test::TEST_F (LoggerTest, test_logDebug1Level)
 
 alexaClientSDK::avsCommon::utils::logger::test::TEST_F (LoggerTest, test_logDebug0Level)
 
 alexaClientSDK::avsCommon::utils::logger::test::TEST_F (LoggerTest, test_logInfoLevel)
 
 alexaClientSDK::avsCommon::utils::logger::test::TEST_F (LoggerTest, test_logWarnLevel)
 
 alexaClientSDK::avsCommon::utils::logger::test::TEST_F (LoggerTest, test_logErrorLevel)
 
 alexaClientSDK::avsCommon::utils::logger::test::TEST_F (LoggerTest, test_logCriticalLevel)
 
 alexaClientSDK::avsCommon::utils::logger::test::TEST_F (LoggerTest, test_logNoneLevel)
 
 alexaClientSDK::avsCommon::utils::logger::test::TEST_F (LoggerTest, test_moduleLoggerObserver)
 
 alexaClientSDK::avsCommon::utils::logger::test::TEST_F (LoggerTest, test_multipleModuleLoggerObservers)
 

Variables

static const std::string alexaClientSDK::avsCommon::utils::logger::test::TEST_SOURCE_STRING = "<The_Source_Of_Log_Entries>"
 String used to test that the source component is logged. More...
 
static const std::string alexaClientSDK::avsCommon::utils::logger::test::TEST_EVENT_STRING = "[Some_Event_Worth_Logging]"
 String used to test that the event component is logged. More...
 
static const std::string alexaClientSDK::avsCommon::utils::logger::test::UNESCAPED_METADATA_VALUE = R"(reserved_chars['\' ',' ':' '='])"
 Metadata value with characters that must be escaped, to exercise the code that escapes metadata values. More...
 
static std::shared_ptr< MockLogger > alexaClientSDK::avsCommon::utils::logger::test::g_log
 Global to hold on to the current MockLogger to use. More...
 

Macro Definition Documentation

◆ DEBUG_COUNT

#define DEBUG_COUNT   0

◆ ESCAPED_METADATA_VALUE

#define ESCAPED_METADATA_VALUE   R"(reserved_chars['\\' '\,' '\:' '\='])"

Escaped version of UNESCAPED_METADATA_VALUE, used to verify proper escaping of metadata values.

◆ KEY_VALUE_PAIR_SEPARATOR

#define KEY_VALUE_PAIR_SEPARATOR   ","

Constant string used to separate key,value pairs from each other.

◆ KEY_VALUE_SEPARATOR

#define KEY_VALUE_SEPARATOR   "="

Constant string used to separate (and connect) keys and values.

◆ LOG_COUNT

#define LOG_COUNT   0

◆ LX

#define LX (   event)    LogEntry(TEST_SOURCE_STRING, event)

Macro used to initial creation of log entries for this source.

◆ METADATA_EXPECTED_BOOLEANS

#define METADATA_EXPECTED_BOOLEANS
Value:
KEY_VALUE_PAIR_SEPARATOR \
METADATA_KEY_FALSE KEY_VALUE_SEPARATOR "false"
#define METADATA_KEY_TRUE
Key for boolean true metadata value.
Definition: LoggerTest.cpp:38
#define KEY_VALUE_SEPARATOR
Constant string used to separate (and connect) keys and values.
Definition: LoggerTest.cpp:44

Expected output string for test of boolean metadata.

◆ METADATA_KEY

#define METADATA_KEY   "metadata_key"

String used to verify passing metadata keys.

◆ METADATA_KEY_FALSE

#define METADATA_KEY_FALSE   "key_false"

Key for boolean false metadata value.

◆ METADATA_KEY_TRUE

#define METADATA_KEY_TRUE   "key_true"

Key for boolean true metadata value.

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