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::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 char *source, const char *event)
 
 LogEntry (const std::string &source, const char *event)
 
 LogEntry (const std::string &source, const std::string &event)
 
template<typename ValueType >
LogEntryd (const std::string &key, const ValueType &value)
 
LogEntryd (const char *key, const char *value)
 
LogEntryd (const char *key, char *value)
 
LogEntryd (const char *key, const std::string &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, const 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/3]

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

Constructor.

Parameters
[in]sourceThe name of the source of this log entry. If source is nullptr, it is treated as an empty string.
[in]eventThe name of the event that this log entry describes. If event is nullptr, it is treated as an empty string.

◆ LogEntry() [2/3]

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

Constructor.

Parameters
[in]sourceThe name of the source of this log entry.
[in]eventThe name of the event that this log entry describes. If event is nullptr, it is treated as an empty string.

◆ LogEntry() [3/3]

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

Constructor.

Parameters
[in]sourceThe name of the source of this log entry.
[in]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/6]

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

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

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

◆ d() [2/6]

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
[in]keyThe key identifying the value to add to this LogEntry.
[in]valueThe value to add to this LogEntry. If value is nullptr, it is treated as an empty string.
Returns
This instance to facilitate adding more information to this log entry.

◆ d() [3/6]

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

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

Parameters
[in]keyThe key identifying the value to add to this LogEntry.
[in]valueThe value to add to this LogEntry. If value is nullptr, it is treated as an empty string.
Returns
This instance to facilitate adding more information to this log entry.

◆ d() [4/6]

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
[in]keyThe key identifying the value to add to this LogEntry.
[in]valueThe value to add to this LogEntry.
Returns
This instance to facilitate adding more information to this log entry.

◆ d() [5/6]

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
[in]keyThe key identifying the value to add to this LogEntry.
[in]valueThe boolean value to add to this LogEntry.
Returns
This instance to facilitate adding more information to this log entry.

◆ d() [6/6]

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
[in]keyThe key identifying the value to add to this LogEntry.
[in]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
[in]messageThe message to add to the end of the text of this LogEntry. If message is a nullptr, it is treated as an empty string.
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
[in]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 
)

Add data in the form of a key, value pair to the metadata of this log entry. If the value includes a privacy denylist 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 denylist.

Parameters
[in]keyThe key identifying the value to add to this LogEntry.
[in]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 
)
inline

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
[in]keyThe key identifying the value to add to this LogEntry. If key is a nullptr, it is treated as an empty string.
[in]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,
const 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
[in]keyThe key identifying the value to add to this LogEntry. If key is a nullptr, it is treated as an empty string.
[in]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
[in]keyThe key identifying the value to add to this LogEntry.
[in]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 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