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

LogEntry is used to compile the log entry text to log via Logger. More...

#include <LogEntry.h>

Public Member Functions

 LogEntry (const std::string &source, const char *event)
 
 LogEntry (const std::string &source, const std::string &event)
 
LogEntryd (const std::string &key, const char *value)
 
LogEntryd (const char *key, char *value)
 
LogEntryd (const char *key, const char *value)
 
LogEntryd (const std::string &key, const std::string &value)
 
LogEntryd (const char *key, const std::string &value)
 
LogEntryd (const std::string &key, bool value)
 
LogEntryd (const char *key, bool value)
 
template<typename ValueType >
LogEntryd (const char *key, const ValueType &value)
 
template<typename ValueType >
LogEntrysensitive (const char *key, const ValueType &value)
 
LogEntryobfuscatePrivateData (const char *key, const std::string &value)
 
LogEntrym (const char *message)
 
LogEntrym (const std::string &message)
 
template<typename PtrType >
LogEntryp (const char *key, const std::shared_ptr< PtrType > &ptr)
 
LogEntryp (const char *key, void *ptr)
 
const char * c_str () const
 

Detailed Description

LogEntry is used to compile the log entry text to log via Logger.

Constructor & Destructor Documentation

◆ LogEntry() [1/2]

alexaClientSDK::avsCommon::utils::logger::LogEntry::LogEntry ( const std::string &  source,
const char *  event 
)

Constructor.

Parameters
sourceThe name of the source of this log entry.
eventThe name of the event that this log entry describes.

◆ LogEntry() [2/2]

alexaClientSDK::avsCommon::utils::logger::LogEntry::LogEntry ( const std::string &  source,
const std::string &  event 
)

Constructor.

Parameters
sourceThe name of the source of this log entry.
eventThe name of the event that this log entry describes.

Member Function Documentation

◆ c_str()

const char * alexaClientSDK::avsCommon::utils::logger::LogEntry::c_str ( ) const

Get the rendered text of this LogEntry.

Returns
The rendered text of this LogEntry. The returned buffer is only guaranteed to be valid for the lifetime of this LogEntry, and only as long as no further modifications are made to it.

◆ d() [1/8]

LogEntry & alexaClientSDK::avsCommon::utils::logger::LogEntry::d ( const std::string &  key,
const char *  value 
)

Add a key, value pair to the metadata of this log entry.

Parameters
keyThe key identifying the value to add to this LogEntry.
valueThe value to add to this LogEntry.
Returns
This instance to facilitate adding more information to this log entry.

◆ d() [2/8]

LogEntry & alexaClientSDK::avsCommon::utils::logger::LogEntry::d ( const char *  key,
char *  value 
)

Add a key, value pair to the metadata of this log entry.

Parameters
keyThe key identifying the value to add to this LogEntry.
valueThe value to add to this LogEntry.
Returns
This instance to facilitate adding more information to this log entry.

◆ d() [3/8]

LogEntry & alexaClientSDK::avsCommon::utils::logger::LogEntry::d ( const char *  key,
const char *  value 
)

Add a key, value pair to the metadata of this log entry.

Parameters
keyThe key identifying the value to add to this LogEntry.
valueThe value to add to this LogEntry.
Returns
This instance to facilitate adding more information to this log entry.

◆ d() [4/8]

LogEntry & alexaClientSDK::avsCommon::utils::logger::LogEntry::d ( const std::string &  key,
const std::string &  value 
)

Add data (hence the name 'd') in the form of a key, value pair to the metadata of this log entry.

Parameters
keyThe key identifying the value to add to this LogEntry.
valueThe value to add to this LogEntry.
Returns
This instance to facilitate adding more information to this log entry.

◆ d() [5/8]

LogEntry & alexaClientSDK::avsCommon::utils::logger::LogEntry::d ( const char *  key,
const std::string &  value 
)

Add data (hence the name 'd') in the form of a key, value pair to the metadata of this log entry.

Parameters
keyThe key identifying the value to add to this LogEntry.
valueThe value to add to this LogEntry.
Returns
This instance to facilitate adding more information to this log entry.

◆ d() [6/8]

LogEntry & alexaClientSDK::avsCommon::utils::logger::LogEntry::d ( const std::string &  key,
bool  value 
)

Add data (hence the name 'd') in the form of a key, value pair to the metadata of this log entry.

Parameters
keyThe key identifying the value to add to this LogEntry.
valueThe boolean value to add to this LogEntry.
Returns
This instance to facilitate adding more information to this log entry.

◆ d() [7/8]

LogEntry & alexaClientSDK::avsCommon::utils::logger::LogEntry::d ( const char *  key,
bool  value 
)

Add data (hence the name 'd') in the form of a key, value pair to the metadata of this log entry.

Parameters
keyThe key identifying the value to add to this LogEntry.
valueThe boolean value to add to this LogEntry.
Returns
This instance to facilitate adding more information to this log entry.

◆ d() [8/8]

template<typename ValueType >
LogEntry & alexaClientSDK::avsCommon::utils::logger::LogEntry::d ( const char *  key,
const ValueType &  value 
)
inline

Add data (hence the name 'd') in the form of a key, value pair to the metadata of this log entry.

Parameters
keyThe key identifying the value to add to this LogEntry.
valueThe value to add to this LogEntry.
Returns
This instance to facilitate adding more information to this log entry.

◆ m() [1/2]

LogEntry & alexaClientSDK::avsCommon::utils::logger::LogEntry::m ( const char *  message)

Add an arbitrary message to the end of the text of this LogEntry. Once this has been called no other additions should be made to this LogEntry.

Parameters
messageThe message to add to the end of the text of this LogEntry.
Returns
This instance to facilitate passing this instance on.

◆ m() [2/2]

LogEntry & alexaClientSDK::avsCommon::utils::logger::LogEntry::m ( const std::string &  message)

Add an arbitrary message to the end of the text of this LogEntry. Once this has been called no other additions should be made to this LogEntry.

Parameters
messageThe message to add to the end of the text of this LogEntry.
Returns
This instance to facilitate passing this instance on.

◆ obfuscatePrivateData()

LogEntry & alexaClientSDK::avsCommon::utils::logger::LogEntry::obfuscatePrivateData ( const char *  key,
const std::string &  value 
)
inline

Add data in the form of a key, value pair to the metadata of this log entry. If the value includes a privacy blacklist entry, the portion after that will be obfuscated. This is done in a distinct method (instead of m or d) to avoid the cost of always checking against the blacklist.

Parameters
keyThe key identifying the value to add to this LogEntry.
valueThe value to add to this LogEntry, obfuscated if needed.
Returns
This instance to facilitate adding more information to this log entry.

◆ p() [1/2]

template<typename PtrType >
LogEntry & alexaClientSDK::avsCommon::utils::logger::LogEntry::p ( const char *  key,
const std::shared_ptr< PtrType > &  ptr 
)

Add pointer (hence the name 'p') in the form of a key, address of the object pointed to by the shared_ptr ptr to the metadata of this log entry.

Parameters
keyThe key identifying the value to add to this LogEntry.
ptrThe shared_ptr of the object to add to this LogEntry.
Returns
This instance to facilitate adding more information to this log entry.

◆ p() [2/2]

LogEntry & alexaClientSDK::avsCommon::utils::logger::LogEntry::p ( const char *  key,
void *  ptr 
)

Add pointer (hence the name 'p') in the form of a key, address of the raw ptr to the metadata of this log entry.

Parameters
keyThe key identifying the value to add to this LogEntry.
ptrThe raw pointer of the object to add to this LogEntry.
Returns
This instance to facilitate adding more information to this log entry.

◆ sensitive()

template<typename ValueType >
LogEntry & alexaClientSDK::avsCommon::utils::logger::LogEntry::sensitive ( const char *  key,
const ValueType &  value 
)
inline

Add sensitive data in the form of a key, value pair to the metadata of this log entry. Because the data is 'sensitive' it will only be emitted in DEBUG builds.

Parameters
keyThe key identifying the value to add to this LogEntry.
valueThe value to add to this LogEntry.
Returns
This instance to facilitate adding more information to this log entry.

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

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