AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | Static Public Member Functions | List of all members
alexaClientSDK::sampleApp::ConsolePrinter Class Reference

#include <ConsolePrinter.h>

Inheritance diagram for alexaClientSDK::sampleApp::ConsolePrinter:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::sampleApp::ConsolePrinter:
Collaboration graph
[legend]

Public Member Functions

 ConsolePrinter ()
 
Logger methods
void emit (avsCommon::utils::logger::Level level, std::chrono::system_clock::time_point time, const char *threadMoniker, const char *text) override
 
- 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)
 
void addLogLevelObserver (LogLevelObserverInterface *observer)
 
void removeLogLevelObserver (LogLevelObserverInterface *observer)
 

Static Public Member Functions

static void simplePrint (const std::string &stringToPrint)
 
static void prettyPrint (const std::string &stringToPrint)
 
static void prettyPrint (std::initializer_list< std::string > lines)
 
static void captionsPrint (const std::vector< std::string > &lines)
 

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

A simple class that prints to the screen.

Constructor & Destructor Documentation

◆ ConsolePrinter()

alexaClientSDK::sampleApp::ConsolePrinter::ConsolePrinter ( )

Constructor.

Deprecated:
(instances of ConsolePrinter needlessly duplicate ConsoleLogger functionality.)

Member Function Documentation

◆ captionsPrint()

void alexaClientSDK::sampleApp::ConsolePrinter::captionsPrint ( const std::vector< std::string > &  lines)
static

Prints a decorated multi-line message with a pretty format with a newline after, along with an "Alexa Says" header, used for outputting captions.

Parameters
linesThe strings representing captions from Alexa's voice.

◆ emit()

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

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().

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 entry to log.

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

◆ prettyPrint() [1/2]

void alexaClientSDK::sampleApp::ConsolePrinter::prettyPrint ( const std::string &  stringToPrint)
static

Prints a message with a pretty format with a
after.

Parameters
stringToPrintThe string to print.

◆ prettyPrint() [2/2]

void alexaClientSDK::sampleApp::ConsolePrinter::prettyPrint ( std::initializer_list< std::string >  lines)
static

Prints a multi-line message with a pretty format with a
after.

Parameters
linesThe strings to print.

◆ simplePrint()

void alexaClientSDK::sampleApp::ConsolePrinter::simplePrint ( const std::string &  stringToPrint)
static

Prints a simple message along with an
.

Parameters
stringToPrintThe string to print.

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

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