AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
LogEntryBuffer.h
Go to the documentation of this file.
1 /*
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0/
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #ifndef ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_INCLUDE_AVSCOMMON_UTILS_LOGGER_LOGENTRYBUFFER_H_
17 #define ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_INCLUDE_AVSCOMMON_UTILS_LOGGER_LOGENTRYBUFFER_H_
18 
19 #include <memory>
20 #include <streambuf>
21 #include <vector>
22 
31 #ifndef ACSDK_LOG_ENTRY_BUFFER_SMALL_BUFFER_SIZE
32 #define ACSDK_LOG_ENTRY_BUFFER_SMALL_BUFFER_SIZE 128
33 #endif
34 
35 namespace alexaClientSDK {
36 namespace avsCommon {
37 namespace utils {
38 namespace logger {
39 
45 class LogEntryBuffer : public std::streambuf {
46 public:
49 
50  int_type overflow(int_type ch) override;
51 
57  const char* c_str() const;
58 
59 private:
61  char m_smallBuffer[ACSDK_LOG_ENTRY_BUFFER_SMALL_BUFFER_SIZE];
62 
64  char* m_base;
65 
67  std::unique_ptr<std::vector<char>> m_largeBuffer;
68 };
69 
70 } // namespace logger
71 } // namespace utils
72 } // namespace avsCommon
73 } // namespace alexaClientSDK
74 
75 #endif // ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_INCLUDE_AVSCOMMON_UTILS_LOGGER_LOGENTRYBUFFER_H_
Definition: LogEntryBuffer.h:45
const char * c_str() const
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
LogEntryBuffer()
Construct an empty LogEntryBuffer.
#define ACSDK_LOG_ENTRY_BUFFER_SMALL_BUFFER_SIZE
Definition: LogEntryBuffer.h:32
int_type overflow(int_type ch) override

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