AlexaClientSDK  3.0.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::sampleApplications::ipcServerSampleApp::ConsolePrinter Class Reference

#include <ConsolePrinter.h>

Inheritance diagram for alexaClientSDK::sampleApplications::ipcServerSampleApp::ConsolePrinter:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::sampleApplications::ipcServerSampleApp::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::sampleApplications::ipcServerSampleApp::ConsolePrinter::ConsolePrinter ( )

Constructor.

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

Member Function Documentation

◆ captionsPrint()

static void alexaClientSDK::sampleApplications::ipcServerSampleApp::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::sampleApplications::ipcServerSampleApp::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
[in]levelThe severity Level of this log line.
[in]timeThe time that the event to log occurred.
[in]threadMonikerMoniker of the thread that generated the event.
[in]textThe text of the entry to log.

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

◆ prettyPrint() [1/2]

static void alexaClientSDK::sampleApplications::ipcServerSampleApp::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]

static void alexaClientSDK::sampleApplications::ipcServerSampleApp::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()

static void alexaClientSDK::sampleApplications::ipcServerSampleApp::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 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