Adds further ext deps as-is binaries copies from customers env.
Qt6 Migration CI / migrate (push) Canceled after 0s
Qt6 Migration CI / migrate (push) Canceled after 0s
This commit is contained in:
3700 files changed
+2132394
No files matched your search
+61
@@ -0,0 +1,61 @@
|
||||
#pragma once
|
||||
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <functional>
|
||||
#include <fstream>
|
||||
#include <mutex>
|
||||
|
||||
#include "ddkit/utils/Logger.hpp"
|
||||
|
||||
namespace ddkit {
|
||||
namespace utils {
|
||||
namespace log {
|
||||
namespace sinks {
|
||||
|
||||
// writes all lines to std::ostream after applying ANSI color codes
|
||||
class OStreamSink : public Sink {
|
||||
|
||||
public:
|
||||
OStreamSink(const base::IConfig& config, std::ostream& stream);
|
||||
void write(Level level, const std::string& prefix, const std::string& line) override;
|
||||
|
||||
private:
|
||||
std::mutex m_writeMutex;
|
||||
bool m_doColorize;
|
||||
std::ostream& m_stream;
|
||||
static const Registrar<OStreamSink> s_registrarCerr;
|
||||
static const Registrar<OStreamSink> s_registrarCout;
|
||||
};
|
||||
|
||||
// writes all lines to logfile
|
||||
class FileSink : public Sink {
|
||||
|
||||
public:
|
||||
FileSink(const base::IConfig& config);
|
||||
void write(Level level, const std::string& prefix, const std::string& line) override;
|
||||
|
||||
private:
|
||||
void openFile();
|
||||
void rotateLog();
|
||||
void incrementFileRecursive(size_t count); // moves m_file<count> to m_file<count+1>
|
||||
|
||||
// log rotate settings
|
||||
bool m_rotateOnStartup;
|
||||
size_t m_rotateOnFileSize;
|
||||
size_t m_rotateOnLineCount;
|
||||
size_t m_rotateKeptFileCount;
|
||||
|
||||
size_t m_currentLinesInFile;
|
||||
|
||||
std::mutex m_writeMutex;
|
||||
std::mutex m_logRotateMutex;
|
||||
std::string m_filename;
|
||||
std::ofstream m_fh;
|
||||
static const Registrar<FileSink> s_registrar;
|
||||
};
|
||||
|
||||
} // namespace sinks
|
||||
} // namespace log
|
||||
} // namespace utils
|
||||
} // namespace ddkit
|
||||
Reference in new issue
Block a user