AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
alexaClientSDK::avsCommon::utils::logger::test::MockLogger Class Reference
Inheritance diagram for alexaClientSDK::avsCommon::utils::logger::test::MockLogger:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::avsCommon::utils::logger::test::MockLogger:
Collaboration graph
[legend]

Public Member Functions

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

Static Public Member Functions

static std::shared_ptr< NiceMock< MockLogger > > create ()
 

Public Attributes

std::chrono::system_clock::time_point m_lastTime
 The last time value passed in a log(...) call. More...
 
std::string m_lastThreadMoniker
 The last thread moniker passed in a log(...) call. More...
 
std::string m_lastText
 The last text value passed in a log(...) call. More...
 

Additional Inherited Members

- Protected Member Functions inherited from alexaClientSDK::avsCommon::utils::logger::Logger
void init (const configuration::ConfigurationNode configuration)
 
- 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...
 

Detailed Description

Mock derivation of Logger for verifying calls and parameters to those calls.

Constructor & Destructor Documentation

◆ MockLogger()

alexaClientSDK::avsCommon::utils::logger::test::MockLogger::MockLogger ( )

MockLogger constructor.

Member Function Documentation

◆ create()

std::shared_ptr< NiceMock< MockLogger > > alexaClientSDK::avsCommon::utils::logger::test::MockLogger::create ( )
static

Create a new MockLogger instance.

Returns
A new MockLogger instance.

◆ MOCK_METHOD1()

alexaClientSDK::avsCommon::utils::logger::test::MockLogger::MOCK_METHOD1 ( shouldLog  ,
bool(Level level)   
)

◆ MOCK_METHOD4()

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

◆ mockEmit()

void alexaClientSDK::avsCommon::utils::logger::test::MockLogger::mockEmit ( Level  level,
std::chrono::system_clock::time_point  time,
const char *  threadId,
const char *  text 
)

Helper method or capturing parameters so that they can be compared to expected values.

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

Member Data Documentation

◆ m_lastText

std::string alexaClientSDK::avsCommon::utils::logger::test::MockLogger::m_lastText

The last text value passed in a log(...) call.

◆ m_lastThreadMoniker

std::string alexaClientSDK::avsCommon::utils::logger::test::MockLogger::m_lastThreadMoniker

The last thread moniker passed in a log(...) call.

◆ m_lastTime

std::chrono::system_clock::time_point alexaClientSDK::avsCommon::utils::logger::test::MockLogger::m_lastTime

The last time value passed in a log(...) call.


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

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