-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathLoggerSink.h
46 lines (34 loc) · 1.53 KB
/
LoggerSink.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#pragma once
namespace MicrosoftInstrumentationEngine
{
class CLoggerService;
// Base class for individual logging targets to implement. This is only meant to be extended
// by internal logging sinks and allow for separation of concerns, not as an extensibility mechanism.
class ILoggerSink
{
friend CLoggerService;
protected:
// Initializes the sink with the logger service instance
virtual HRESULT Initialize(_In_ CLoggerService* pLogging) = 0;
// Log a message to the logging target.
virtual void LogMessage(_In_ LPCWSTR wszMessage) = 0;
// Log an error to the logging target.
virtual void LogError(_In_ LPCWSTR wszMessage) = 0;
// Log a dump message to the logging target.
virtual void LogDumpMessage(_In_ LPCWSTR wszMessage) = 0;
// Called when a logging aspect has changed (e.g. flags, host, etc) and allows the sink
// to report which flags it cares to handle.
virtual HRESULT Reset(_In_ LoggingFlags defaultFlags, _Out_ LoggingFlags* pEffectiveFlags) = 0;
// Called when the sink will no longer be used and can release resources.
virtual HRESULT Shutdown() { return S_OK; };
};
class IFileLoggerSink
{
friend CLoggerService;
protected:
virtual HRESULT SetLogFilePath(_In_ LPCWSTR wszLogFilePath) = 0;
virtual HRESULT SetLogFileLevel(_In_ LoggingFlags fileLogFlags) = 0;
};
}