Class ILogManager
Defined in File ILogManager.hpp
Inheritance Relationships
Base Types
public Microsoft::Applications::Events::ILogController(Class ILogController)public Microsoft::Applications::Events::IContextProvider(Class IContextProvider)public Microsoft::Applications::Events::DebugEventDispatcher(Class DebugEventDispatcher)
Derived Type
public Microsoft::Applications::Events::NullLogManager(Class NullLogManager)
Class Documentation
-
class Microsoft::Applications::Events::ILogManager : public Microsoft::Applications::Events::ILogController, public Microsoft::Applications::Events::IContextProvider, public Microsoft::Applications::Events::DebugEventDispatcher
This class is used to manage the Events logging system
Subclassed by Microsoft::Applications::Events::NullLogManager
Public Functions
-
virtual bool DispatchEvent(DebugEvent evt) override = 0
Dispatches event to this ILogManager instance.
- Parameters
evt – DebugEvent
- Returns
-
inline virtual ~ILogManager()
Destroy the telemetry logging system instance.
Calls
FlushAndTeardown()implicitly.
-
virtual void Configure() = 0
-
virtual ISemanticContext &GetSemanticContext() = 0
Retrieve an ISemanticContext interface through which to specify context information such as device, system, hardware and user information.
Context information set via this API will apply to all logger instance unless they are overwritten by individual logger instance.
- Returns
ISemanticContext interface pointer
-
virtual status_t SetContext(std::string const &name, std::string const &value, PiiKind piiKind = PiiKind_None) = 0
Adds or = 0s a property of the custom context for the telemetry logging system.
Context information set here applies to events generated by all ILogger instances unless it is overwritten on a particular ILogger instance.
- Parameters
name – Name of the context property
value – String value of the context property
piiKind – PIIKind of the context with PiiKind_None as the default
-
virtual status_t SetContext(const std::string &name, const char *value, PiiKind piiKind = PiiKind_None) = 0
Adds or = 0s a property of the custom context for the telemetry logging system.
Context information set here applies to events generated by all ILogger instances unless it is overwritten on a particular ILogger instance.
- Parameters
name – Name of the context property
value – Value of the context property
piiKind – PIIKind of the context with PiiKind_None as the default
-
virtual status_t SetContext(const std::string &name, double value, PiiKind piiKind = PiiKind_None) = 0
Adds or = 0s a property of the global context.
- Parameters
name – Name of the property
value – Double value of the property
-
virtual status_t SetContext(const std::string &name, int64_t value, PiiKind piiKind = PiiKind_None) = 0
Adds or = 0s a property of the global context.
- Parameters
name – Name of the property
value – 64-bit Integer value of the property
-
virtual status_t SetContext(const std::string &name, int8_t value, PiiKind piiKind = PiiKind_None) = 0
Adds or = 0s a property of the global context.
All integer types other than int64_t are currently being converted to int64_t
- Parameters
name – Name of the property
value – 8-bit Integer value of the property
-
virtual status_t SetContext(const std::string &name, int16_t value, PiiKind piiKind = PiiKind_None) = 0
Adds or = 0s a property of the global context.
All integer types other than int64_t are currently being converted to int64_t
- Parameters
name – Name of the property
value – 16-bit Integer value of the property
-
virtual status_t SetContext(const std::string &name, int32_t value, PiiKind piiKind = PiiKind_None) = 0
Adds or = 0s a property of the global context.
All integer types other than int64_t are currently being converted to int64_t
- Parameters
name – Name of the property
value – 32-bit Integer value of the property
-
virtual status_t SetContext(const std::string &name, uint8_t value, PiiKind piiKind = PiiKind_None) = 0
Adds or = 0s a property of the global context.
All integer types other than int64_t are currently being converted to int64_t
- Parameters
name – Name of the property
value – 8-bit unsigned integer value of the property
-
virtual status_t SetContext(const std::string &name, uint16_t value, PiiKind piiKind = PiiKind_None) = 0
Adds or = 0s a property of the global context.
All integer types other than int64_t are currently being converted to int64_t
- Parameters
name – Name of the property
value – 16-bit unsigned integer value of the property
-
virtual status_t SetContext(const std::string &name, uint32_t value, PiiKind piiKind = PiiKind_None) = 0
Adds or = 0s a property of the global context.
All integer types other than int64_t are currently being converted to int64_t
- Parameters
name – Name of the property
value – 32-bit unsigned integer value of the property
-
virtual status_t SetContext(const std::string &name, uint64_t value, PiiKind piiKind = PiiKind_None) = 0
Adds or = 0s a property of the global context.
All integer types other than int64_t are currently being converted to int64_t
- Parameters
name – Name of the property
value – 64-bit unsigned integer value of the property
-
virtual status_t SetContext(const std::string &name, bool value, PiiKind piiKind = PiiKind_None) = 0
Adds or = 0s a property of the global context.
- Parameters
name – Name of the property
value – Boolean value of the property
-
virtual status_t SetContext(const std::string &name, time_ticks_t value, PiiKind piiKind = PiiKind_None) = 0
Adds or = 0s a property of the global context.
- Parameters
name – Name of the property
value – .NET time ticks
-
virtual status_t SetContext(const std::string &name, GUID_t value, PiiKind piiKind = PiiKind_None) = 0
Adds or overrides a property of the global context.
- Parameters
name – Name of the property
value – GUID
-
virtual ILogger *GetLogger(std::string const &tenantToken, std::string const &source = std::string(), std::string const &scope = std::string()) = 0
Retrieves the ILogger interface of a Logger instance through which you can log telemetry events.
It associates the ILogger interface with the specified scope/project set (reserved for future use).
- Parameters
tenantToken – A string that contains the tenant token associated with this application.
source – A string that contains the name of the source of events.
scope – A string that contains the logger scope/project set (reserved for future use).
- Returns
A pointer to the ILogger instance.
-
virtual ILogConfiguration &GetLogConfiguration() = 0
Retrieves the current LogManager instance configuration
-
virtual void AddEventListener(DebugEventType type, DebugEventListener &listener) = 0
Adds the event listener.
- Parameters
type – The type.
listener – The listener.
-
virtual void RemoveEventListener(DebugEventType type, DebugEventListener &listener) = 0
Removes the event listener.
- Parameters
type – The type.
listener – The listener.
-
virtual bool AttachEventSource(DebugEventSource &other) = 0
Attach cascaded DebugEventSource to forward all debug events to
-
virtual bool DetachEventSource(DebugEventSource &other) = 0
Detach cascaded DebugEventSource to forward all debug events to
-
virtual LogSessionData *GetLogSessionData() override = 0
Gets the log session data.
- Returns
The log session data in a pointer to a LogSessionData object.
-
virtual void ResetLogSessionData() = 0
Resets the log session data.
-
virtual ILogController *GetLogController() = 0
Retrieves the ILogController interface of LogManager to control transmission pipe.
- Returns
Pointer to the ILogController interface
-
virtual IAuthTokensController *GetAuthTokensController() override = 0
Set the Auth ticket controller
-
virtual IEventFilterCollection &GetEventFilters() noexcept = 0
Get collection of current event filters.
-
virtual const IEventFilterCollection &GetEventFilters() const noexcept = 0
Get collection of current event filters.
-
virtual void SetLevelFilter(uint8_t defaultLevel, uint8_t levelMin, uint8_t levelMax) = 0
Sets the diagnostic level for the LogManager
- Parameters
defaultLevel – Diagnostic level for the LogManager
levelMin – Minimum level to be sent
levelMin – Maximum level to be sent
-
virtual void SetLevelFilter(uint8_t defaultLevel, const std::set<uint8_t> &allowedLevels) = 0
Sets the diagnostic level for the LogManager
- Parameters
defaultLevel – Diagnostic level for the LogManager
allowedLevels – Set with levels that are allowed to be sent
-
virtual IDataViewerCollection &GetDataViewerCollection() = 0
Gets an instance of the Data Viewer Collection.
- Returns
A reference to the IDataViewerCollection instance
-
virtual const IDataViewerCollection &GetDataViewerCollection() const = 0
Gets an instance of the Data Viewer Collection.
- Returns
A const reference to the IDataViewerCollection instance
Set the current instance of IDataInspector
- Parameters
dataInspector – Shared Ptr to an instance of IDataInspector
-
virtual void ClearDataInspectors() = 0
Clears all IDataInspectors
-
virtual void RemoveDataInspector(const std::string &name) = 0
Removes specified IDataInspector
- Parameters
name – String name that identifies IDataInspector
-
virtual std::shared_ptr<IDataInspector> GetDataInspector(const std::string &name) noexcept = 0
Get the current instance of IDataInspector specified by the name
- Parameters
name – String name that identifies IDataInspector
- Returns
Selected instance of IDataInspector if available, nullptr otherwise.
-
inline virtual std::shared_ptr<IDataInspector> GetDataInspector() noexcept
Get the current instance of IDataInspector specified by an empty string
- Returns
Selected instance of IDataInspector if available, nullptr otherwise.
-
virtual void PauseActivity() = 0
Ask the log manager to pause activity
-
virtual void ResumeActivity() = 0
Ask the log manager to resume activity
-
virtual void WaitPause() = 0
Wait for pause to complete (no active calls) or resume
-
virtual bool StartActivity() = 0
Start an activity
- Returns
True if we are not paused and the activity may continue.
-
virtual void EndActivity() = 0
End an activity.
StartActivity MUST have returned true: do not call this method if StartActivity returned true.
Public Static Functions
-
static bool DispatchEventBroadcast(DebugEvent evt)
Dispatches broadcast event to all active ILogManager instances.
- Parameters
evt – DebugEvent
- Returns
-
virtual bool DispatchEvent(DebugEvent evt) override = 0