AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | List of all members
alexaClientSDK::avsCommon::utils::logger::LogStringFormatter Class Reference

#include <LogStringFormatter.h>

Public Member Functions

 LogStringFormatter ()
 
std::string format (Level level, std::chrono::system_clock::time_point time, const char *threadMoniker, const char *text)
 
std::string getDateTimeString (std::chrono::system_clock::time_point time)
 
std::string getMillisecondString (std::chrono::system_clock::time_point time)
 

Detailed Description

A class used to format log strings.

Constructor & Destructor Documentation

◆ LogStringFormatter()

alexaClientSDK::avsCommon::utils::logger::LogStringFormatter::LogStringFormatter ( )

Member Function Documentation

◆ format()

std::string alexaClientSDK::avsCommon::utils::logger::LogStringFormatter::format ( Level  level,
std::chrono::system_clock::time_point  time,
const char *  threadMoniker,
const char *  text 
)

Formats a log message into a printable string with other metadata regarding the log message.

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.
Returns
The formatted string.

◆ getDateTimeString()

std::string alexaClientSDK::avsCommon::utils::logger::LogStringFormatter::getDateTimeString ( std::chrono::system_clock::time_point  time)

Transforms a time_point into a string representing the date and time.

Parameters
timeThe time_point.
Returns
A string representing the time_point in "%Y-%m-%d %H:%M:%S" format, or an empty string if failure.

◆ getMillisecondString()

std::string alexaClientSDK::avsCommon::utils::logger::LogStringFormatter::getMillisecondString ( std::chrono::system_clock::time_point  time)

Transforms a time_point into a string representing the milliseconds.

Parameters
timeThe time_point.
Returns
A string representing the number of milliseconds, or an empty string if failure.

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