DotNetDupe 4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Loading...
Searching...
No Matches
LoggerTextWriter.cpp
Go to the documentation of this file.
1#include "pch.h"
5
6namespace DotNetDupe {
7 namespace Extensions {
8 namespace Logging {
9
11 : m_pLogger(LogManager::GetLogger(sCategoryName)), m_logLevel(logLevel) {
13 }
14
16 : m_pLogger(pLogger), m_logLevel(logLevel) {
18 }
19
22 Flush();
23 }
24
27 Close();
28 }
29
32 (void)0;
33 }
34
39
40 void LoggerTextWriter::Write(bool bValue) {
43 }
44
45 void LoggerTextWriter::Write(char chValue) {
48 }
49
50 void LoggerTextWriter::Write(const char* pValue) {
52 if (pValue) {
54 }
55 }
56
59 if (!sValue.IsEmpty() && !m_pLogger.IsNull()) {
60 m_pLogger->Log(m_logLevel, sValue);
61 }
62 }
63
64 void LoggerTextWriter::Write(int iValue) {
67 }
68
69 void LoggerTextWriter::Write(long long llValue) {
72 }
73
74 void LoggerTextWriter::Write(float fValue) {
77 }
78
79 void LoggerTextWriter::Write(double dValue) {
82 }
83
88
89 void LoggerTextWriter::WriteLine(bool bValue) {
91 Write(bValue);
92 }
93
94 void LoggerTextWriter::WriteLine(char chValue) {
96 Write(chValue);
97 }
98
99 void LoggerTextWriter::WriteLine(const char* pValue) {
101 Write(pValue);
102 }
103
106 Write(sValue);
107 }
108
111 Write(iValue);
112 }
113
114 void LoggerTextWriter::WriteLine(long long llValue) {
116 Write(llValue);
117 }
118
119 void LoggerTextWriter::WriteLine(float fValue) {
121 Write(fValue);
122 }
123
124 void LoggerTextWriter::WriteLine(double dValue) {
126 Write(dValue);
127 }
128
129 }
130 }
131}
Represents character encodings and code page conversions.
Central thread-safe static registry and entry point for application logging.
Definition LogManager.h:18
void Dispose() override
Disposes the writer resources.
void Flush() override
Flushes any buffered text to the logger.
void Close() override
Closes the writer and flushes buffered content.
void Write(bool bValue) override
Writes a boolean value to the logger buffer.
LoggerTextWriter(const DotNetDupe::System::String &sCategoryName="Console", LogLevel logLevel=LogLevel::Information)
Initializes a LoggerTextWriter with category name and log level.
void WriteLine() override
Writes a line terminator, emitting the accumulated buffer to the logger.
virtual System::Text::EncodingPtr GetEncoding() const override
Gets the character encoding for text output (UTF-8).
A unified smart pointer that supports both unique and shared ownership semantics.
Represents text as a sequence of UTF-8 code units with culture-invariant operations.
Definition String.h:74
static String Format(const char *pFormat, const Arg1 &arg1, const Args &... args)
Definition String.h:239
static EncodingPtr UTF8()
Gets an encoding for the UTF-8 format.
LogLevel
Defines logging severity levels.
Definition ILogger.h:15
SmartPointer< Encoding > EncodingPtr
SmartPointer alias for Encoding instances.