AWS SDK for C++
AWS SDK for C++
Loading...
Searching...
No Matches
DefaultLogSystem.h
Go to the documentation of this file.
1
6#pragma once
7
9
15
16#include <thread>
17#include <memory>
18#include <mutex>
19#include <atomic>
20#include <condition_variable>
21
22namespace Aws
23{
24 namespace Utils
25 {
26 namespace Logging
27 {
33 {
34 public:
36
40 DefaultLogSystem(LogLevel logLevel, const std::shared_ptr<Aws::OStream>& logFile);
45 DefaultLogSystem(LogLevel logLevel, const Aws::String& filenamePrefix);
46
48
53 void Flush() override;
54
59 {
60 public:
61 LogSynchronizationData() : m_stopLogging(false) {}
62
63 std::mutex m_logQueueMutex;
64 std::condition_variable m_queueSignal;
67
68 private:
70 LogSynchronizationData& operator =(const LogSynchronizationData& rhs) = delete;
71 };
72
73 protected:
77 virtual void ProcessFormattedStatement(Aws::String&& statement) override;
78
79 private:
80 DefaultLogSystem(const DefaultLogSystem& rhs) = delete;
81 DefaultLogSystem& operator =(const DefaultLogSystem& rhs) = delete;
82
83 LogSynchronizationData m_syncData;
84
85 std::thread m_loggingThread;
86 };
87
88 } // namespace Logging
89 } // namespace Utils
90} // namespace Aws
#define AWS_CORE_API
Definition: Core_EXPORTS.h:26
DefaultLogSystem(LogLevel logLevel, const std::shared_ptr< Aws::OStream > &logFile)
virtual void ProcessFormattedStatement(Aws::String &&statement) override
DefaultLogSystem(LogLevel logLevel, const Aws::String &filenamePrefix)
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
Definition: AWSString.h:97
std::vector< T, Aws::Allocator< T > > Vector
Definition: AWSVector.h:17