Class NullLogManager

Inheritance Relationships

Base Type

Class Documentation

class Microsoft::Applications::Events::NullLogManager : public Microsoft::Applications::Events::ILogManager

Public Functions

inline NullLogManager()
inline virtual bool DispatchEvent(DebugEvent) override

Dispatches event to this ILogManager instance.

Parameters

evtDebugEvent

Returns

inline virtual void Configure() override
inline virtual void FlushAndTeardown() override

Flushes any pending telemetry events in memory to disk, and tears-down the telemetry logging system.

inline virtual status_t Flush() override

Flushes any pending telemetry events in memory to disk, to reduce possible data loss.

This method can be expensive, so you should use it sparingly. The operating system blocks the calling thread and might flush the global file buffers (all buffered file system data) to disk, which can be time consuming.

inline virtual status_t UploadNow() override

Attempts to send any pending telemetry events that are currently cached either in memory, or on disk.

inline virtual status_t PauseTransmission() override

Pauses the transmission of events to the data collector.

While paused, events continue to be queued on the client, cached either in memory or on disk.

inline virtual status_t ResumeTransmission() override

Resumes the transmission of events to the data collector.

inline virtual status_t SetTransmitProfile(TransmitProfile profile) override

Sets the transmit profile for event transmission - to one of the built-in profiles.

A transmit profile is a collection of hardware and system settings (like network connectivity, power state) based on which to determine how events are to be transmitted.

Parameters

profile – Transmit profile, as one of the ::TransmitProfile enumeration values.

Returns

This method doesn’t return a value - because it always succeeds.

inline virtual status_t SetTransmitProfile(const std::string &profile) override

Sets the transmit profile for event transmission.

A transmit profile is a collection of hardware and system settings (like network connectivity, power state, etc.).

Parameters

profile – A string that contains the transmit profile.

Returns

A boolean value that indicates success (true) or failure (false).

inline virtual status_t LoadTransmitProfiles(const std::string &profiles_json) override

Loads transmit profiles formatted in JSON.

Parameters

profiles_json – A string that contains the transmit profiles in JSON.

Returns

A boolean value that indicates success (true) or failure (false) if the configuration is invalid.

inline virtual status_t LoadTransmitProfiles(const std::vector<TransmitProfileRules> &profiles) noexcept override

Loads transmit profiles.

Parameters

profiles – A collection of transmit profiles

Returns

A boolean value that indicates success (true) or failure (false) if the configuration is invalid.

inline virtual status_t ResetTransmitProfiles() override

Resets transmission profiles to default settings.

inline virtual ILogConfiguration &GetLogConfiguration() override

Retrieves the current LogManager instance configuration

inline virtual const std::string &GetTransmitProfileName() override

Gets the name of the current transmit profile.

inline virtual ISemanticContext &GetSemanticContext() override

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

inline virtual status_t SetContext(std::string const&, std::string const&, PiiKind = PiiKind_None) override

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

inline virtual status_t SetContext(const std::string&, const char*, PiiKind = PiiKind_None) override

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

inline virtual status_t SetContext(const std::string&, double, PiiKind = PiiKind_None) override

Adds or = 0s a property of the global context.

Parameters
  • name – Name of the property

  • value – Double value of the property

inline virtual status_t SetContext(const std::string&, int64_t, PiiKind = PiiKind_None) override

Adds or = 0s a property of the global context.

Parameters
  • name – Name of the property

  • value – 64-bit Integer value of the property

inline virtual status_t SetContext(const std::string&, int8_t, PiiKind = PiiKind_None) override

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

inline virtual status_t SetContext(const std::string&, int16_t, PiiKind = PiiKind_None) override

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

inline virtual status_t SetContext(const std::string&, int32_t, PiiKind = PiiKind_None) override

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

inline virtual status_t SetContext(const std::string&, uint8_t, PiiKind = PiiKind_None) override

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

inline virtual status_t SetContext(const std::string&, uint16_t, PiiKind = PiiKind_None) override

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

inline virtual status_t SetContext(const std::string&, uint32_t, PiiKind = PiiKind_None) override

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

inline virtual status_t SetContext(const std::string&, uint64_t, PiiKind = PiiKind_None) override

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

inline virtual status_t SetContext(const std::string&, bool, PiiKind = PiiKind_None) override

Adds or = 0s a property of the global context.

Parameters
  • name – Name of the property

  • value – Boolean value of the property

inline virtual status_t SetContext(const std::string&, time_ticks_t, PiiKind = PiiKind_None) override

Adds or = 0s a property of the global context.

Parameters
  • name – Name of the property

  • value – .NET time ticks

inline virtual status_t SetContext(const std::string&, GUID_t, PiiKind = PiiKind_None) override

Adds or overrides a property of the global context.

Parameters
  • name – Name of the property

  • value – GUID

inline virtual ILogger *GetLogger(std::string const&, std::string const& = std::string(), std::string const& = std::string()) override

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.

inline virtual void AddEventListener(DebugEventType, DebugEventListener&) override

Adds the event listener.

Parameters
  • type – The type.

  • listener – The listener.

inline virtual void RemoveEventListener(DebugEventType, DebugEventListener&) override

Removes the event listener.

Parameters
  • type – The type.

  • listener – The listener.

inline virtual bool AttachEventSource(DebugEventSource&) override

Attach cascaded DebugEventSource to forward all debug events to

inline virtual bool DetachEventSource(DebugEventSource&) override

Detach cascaded DebugEventSource to forward all debug events to

inline virtual LogSessionData *GetLogSessionData() override

Gets the log session data.

Returns

The log session data in a pointer to a LogSessionData object.

inline virtual void ResetLogSessionData() override

Resets the log session data.

inline virtual ILogController *GetLogController() override

Retrieves the ILogController interface of LogManager to control transmission pipe.

Returns

Pointer to the ILogController interface

inline virtual IAuthTokensController *GetAuthTokensController() override

Set the Auth ticket controller

inline virtual IEventFilterCollection &GetEventFilters() noexcept override

Get collection of current event filters.

inline virtual const IEventFilterCollection &GetEventFilters() const noexcept override

Get collection of current event filters.

inline virtual void SetLevelFilter(uint8_t, uint8_t, uint8_t) override

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

inline virtual void SetLevelFilter(uint8_t, const std::set<uint8_t>&) override

Sets the diagnostic level for the LogManager

Parameters
  • defaultLevel – Diagnostic level for the LogManager

  • allowedLevels – Set with levels that are allowed to be sent

inline virtual const IDataViewerCollection &GetDataViewerCollection() const noexcept override

Gets an instance of the Data Viewer Collection.

Returns

A const reference to the IDataViewerCollection instance

inline virtual IDataViewerCollection &GetDataViewerCollection() noexcept override

Gets an instance of the Data Viewer Collection.

Returns

A reference to the IDataViewerCollection instance

inline virtual void SetDataInspector(const std::shared_ptr<IDataInspector>&) override

Set the current instance of IDataInspector

Parameters

dataInspector – Shared Ptr to an instance of IDataInspector

inline virtual void RemoveDataInspector(const std::string&) override

Removes specified IDataInspector

Parameters

name – String name that identifies IDataInspector

inline virtual void ClearDataInspectors() override

Clears all IDataInspectors

inline virtual std::shared_ptr<IDataInspector> GetDataInspector(const std::string&) noexcept override

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 status_t DeleteData() noexcept override

Delete local data

inline virtual void PauseActivity() override

Ask the log manager to pause activity

inline virtual void ResumeActivity() override

Ask the log manager to resume activity

inline virtual void WaitPause() override

Wait for pause to complete (no active calls) or resume

inline virtual bool StartActivity() override

Start an activity

Returns

True if we are not paused and the activity may continue.

inline virtual void EndActivity() override

End an activity.

StartActivity MUST have returned true: do not call this method if StartActivity returned true.