LogEntry is used to compile the log entry text to log via Logger.
More...
#include <LogEntry.h>
|
| 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 > |
LogEntry & | d (const std::string &key, const ValueType &value) |
|
LogEntry & | d (const char *key, const char *value) |
|
LogEntry & | d (const char *key, char *value) |
|
LogEntry & | d (const char *key, const std::string &value) |
|
LogEntry & | d (const char *key, bool value) |
|
template<typename ValueType > |
LogEntry & | d (const char *key, const ValueType &value) |
|
template<typename ValueType > |
LogEntry & | sensitive (const char *key, const ValueType &value) |
|
LogEntry & | obfuscatePrivateData (const char *key, const std::string &value) |
|
LogEntry & | m (const char *message) |
|
LogEntry & | m (const std::string &message) |
|
template<typename PtrType > |
LogEntry & | p (const char *key, const std::shared_ptr< PtrType > &ptr) |
|
LogEntry & | p (const char *key, const void *ptr) |
|
const char * | c_str () const |
|
LogEntry is used to compile the log entry text to log via Logger.
◆ LogEntry() [1/3]
alexaClientSDK::avsCommon::utils::logger::LogEntry::LogEntry |
( |
const char * |
source, |
|
|
const char * |
event |
|
) |
| |
Constructor.
- Parameters
-
[in] | source | The name of the source of this log entry. If source is nullptr, it is treated as an empty string. |
[in] | event | The 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] | source | The name of the source of this log entry. |
[in] | event | The 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] | source | The name of the source of this log entry. |
[in] | event | The name of the event that this log entry describes. |
◆ 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] | key | The key identifying the value to add to this LogEntry. |
[in] | value | The 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] | key | The key identifying the value to add to this LogEntry. |
[in] | value | The 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] | key | The key identifying the value to add to this LogEntry. |
[in] | value | The 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] | key | The key identifying the value to add to this LogEntry. |
[in] | value | The 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] | key | The key identifying the value to add to this LogEntry. |
[in] | value | The 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] | key | The key identifying the value to add to this LogEntry. |
[in] | value | The 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] | message | The 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] | message | The 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] | key | The key identifying the value to add to this LogEntry. |
[in] | value | The 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] | key | The key identifying the value to add to this LogEntry. If key is a nullptr, it is treated as an empty string. |
[in] | ptr | The 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] | key | The key identifying the value to add to this LogEntry. If key is a nullptr, it is treated as an empty string. |
[in] | ptr | The 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] | key | The key identifying the value to add to this LogEntry. |
[in] | value | The 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:
- /workplace/avs-device-sdk/AVSCommon/Utils/include/AVSCommon/Utils/Logger/LogEntry.h
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License, Version 2.0