Show / Hide Table of Contents

Class LogManager

The IPhoenixLogger implementation for Phoenix.

Inheritance
System.Object
LogManager
UILogManager
Implements
IPhoenixLogger
IHostedService
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Phoenix.Logging
Assembly: Phoenix.Core.dll
Syntax
public class LogManager : IPhoenixLogger

Properties

View Source

RegisteredCategories

Gets the list of registered categories.

Declaration
public ReadOnlyCollection<LogCategoryInfo> RegisteredCategories { get; }
Property Value
Type Description
System.Collections.ObjectModel.ReadOnlyCollection<LogCategoryInfo>
View Source

RegisteredPrefixes

Gets the list of registered prefixes.

Declaration
public ReadOnlyCollection<PrefixConfiguration> RegisteredPrefixes { get; }
Property Value
Type Description
System.Collections.ObjectModel.ReadOnlyCollection<PrefixConfiguration>

Methods

View Source

GetRegisteredCategoryById(Guid)

Gets the category info for a registered category.

Declaration
public LogCategoryInfo GetRegisteredCategoryById(Guid id)
Parameters
Type Name Description
System.Guid id

The id for the category.

Returns
Type Description
LogCategoryInfo

The category info or null if not found.

View Source

GetRegisteredCategoryByName(String)

Gets the category info for a registered category.

Declaration
public LogCategoryInfo GetRegisteredCategoryByName(string category)
Parameters
Type Name Description
System.String category

The category name.

Returns
Type Description
LogCategoryInfo

The category info or null if not found.

View Source

IsPrefixRegistered(String)

Checks if a prefix is registered with this logger.

Declaration
public bool IsPrefixRegistered(string prefix)
Parameters
Type Name Description
System.String prefix

The prefix to check.

Returns
Type Description
System.Boolean

True if the prefix is registered, false otherwise.

View Source

Log(String, LogSeverity, String, Object[])

Logs data to any and all active loggers.

Declaration
public void Log(string prefix, LogSeverity severity, string entry, params object[] parameters)
Parameters
Type Name Description
System.String prefix

The prefix to use.

LogSeverity severity

The severity level of this entry.

System.String entry

The log entry to write out.

System.Object[] parameters

Formatting parameters to use with the log entry.

View Source

Log(String, Guid, LogSeverity, String, Object[])

Logs data to any and all active loggers.

Declaration
public void Log(string prefix, Guid categoryId, LogSeverity severity, string entry, params object[] parameters)
Parameters
Type Name Description
System.String prefix

The prefix to use.

System.Guid categoryId

The id of the category to log to.

LogSeverity severity

The severity level of this entry.

System.String entry

The log entry to write out.

System.Object[] parameters

Formatting parameters to use with the log entry.

View Source

Log(String, Guid, String, Object[])

Logs data to any and all active loggers.

Declaration
public void Log(string prefix, Guid categoryId, string entry, params object[] parameters)
Parameters
Type Name Description
System.String prefix

The prefix to use.

System.Guid categoryId

The id of the category to log to.

System.String entry

The log entry to write out.

System.Object[] parameters

Formatting parameters to use with the log entry.

View Source

Log(String, String, Object[])

Logs data to any and all active loggers.

Declaration
public void Log(string prefix, string entry, params object[] parameters)
Parameters
Type Name Description
System.String prefix

The prefix to use.

System.String entry

The log entry to write out.

System.Object[] parameters

Formatting parameters to use with the log entry.

View Source

LogCriticalException(String, Exception)

Logs an exception object to all active loggers as a Critical severity.

Declaration
public void LogCriticalException(string prefix, Exception exception)
Parameters
Type Name Description
System.String prefix

The prefix for this exception.

System.Exception exception

The exception to log.

View Source

LogCriticalException(String, Exception, Boolean)

Logs an exception object to all active loggers as a Critical severity.

Declaration
public void LogCriticalException(string prefix, Exception exception, bool logInner)
Parameters
Type Name Description
System.String prefix

The prefix for this exception.

System.Exception exception

The exception to log.

System.Boolean logInner

Whether or not to log the inner exception

View Source

LogException(String, LogSeverity, Exception)

Logs an exception object to all active loggers.

Declaration
public void LogException(string prefix, LogSeverity severity, Exception exception)
Parameters
Type Name Description
System.String prefix

The prefix for this exception.

LogSeverity severity

The severity level of the exception.

System.Exception exception

The exception to log.

View Source

LogException(String, LogSeverity, Exception, Boolean)

Logs an exception object to all active loggers.

Declaration
public void LogException(string prefix, LogSeverity severity, Exception exception, bool logInner)
Parameters
Type Name Description
System.String prefix

The prefix for this exception.

LogSeverity severity

The severity level of the exception.

System.Exception exception

The exception to log.

System.Boolean logInner

Whether or not to log the inner exception

View Source

Logline(String, LogSeverity, String, Object[])

Logs data to all active loggers and includes a line break at the end.

Declaration
public void Logline(string prefix, LogSeverity severity, string entry, params object[] parameters)
Parameters
Type Name Description
System.String prefix

The prefix to use.

LogSeverity severity

The severity level of this entry.

System.String entry

The log entry to write out.

System.Object[] parameters

Formatting parameters to use with the log entry.

View Source

Logline(String, Guid, LogSeverity, String, Object[])

Logs data to all active loggers and includes a line break at the end.

Declaration
public void Logline(string prefix, Guid categoryId, LogSeverity severity, string entry, params object[] parameters)
Parameters
Type Name Description
System.String prefix

The prefix to use.

System.Guid categoryId

The id of the category to log to.

LogSeverity severity

The severity level of this entry.

System.String entry

The log entry to write out.

System.Object[] parameters

Formatting parameters to use with the log entry.

View Source

Logline(String, Guid, String, Object[])

Logs data to all active loggers and includes a line break at the end.

Declaration
public void Logline(string prefix, Guid categoryId, string entry, params object[] parameters)
Parameters
Type Name Description
System.String prefix

The prefix to use.

System.Guid categoryId

The id of the category to log to.

System.String entry

The log entry to write out.

System.Object[] parameters

Formatting parameters to use with the log entry.

View Source

Logline(String, String, Object[])

Logs data to any and all active loggers and includes a line break at the end.

Declaration
public void Logline(string prefix, string entry, params object[] parameters)
Parameters
Type Name Description
System.String prefix

The prefix to use.

System.String entry

The log entry to write out.

System.Object[] parameters

Formatting parameters to use with the log entry.

View Source

RegisterCategory(String)

Registers a category with a default severity and color for the output window.

Declaration
public Guid RegisterCategory(string category)
Parameters
Type Name Description
System.String category

The name of the category being registered.

Returns
Type Description
System.Guid

The guid of the registered category.

View Source

RegisterOutputHandler(Action<Guid, String, LogSeverity, Color>, LogSeverity[])

Registers a handler function with the logger.

Declaration
public Guid RegisterOutputHandler(Action<Guid, string, LogSeverity, Color> handler, params LogSeverity[] severities)
Parameters
Type Name Description
System.Action<System.Guid, System.String, LogSeverity, System.Windows.Media.Color> handler

The function to send output to.

LogSeverity[] severities

The list of severities to receive.

Returns
Type Description
System.Guid

The Guid of the registered handler.

View Source

RegisterPrefix(String, LogSeverity, Guid, Color, Boolean)

Registers a prefix with the log manager, and disables it based on the saved filter settings.

Declaration
public void RegisterPrefix(string prefix, LogSeverity defaultSeverity, Guid defaultCategoryId, Color textColor, bool showPrefix)
Parameters
Type Name Description
System.String prefix

The prefix to register.

LogSeverity defaultSeverity

The default severity for this prefix.

System.Guid defaultCategoryId

The default category for this prefix.

System.Windows.Media.Color textColor

The color for this prefix.

System.Boolean showPrefix

True to show prefix, false otherwise.

View Source

SetHandlerSeverities(Guid, LogSeverity[])

Sets the severity types that this handler wants to receive.

Declaration
public void SetHandlerSeverities(Guid id, params LogSeverity[] severities)
Parameters
Type Name Description
System.Guid id

The Guid of the registered handler.

LogSeverity[] severities

The severity categories to receive.

View Source

SetUnregisteredPrefixCategory(String)

Sets the category to use with a when an unregistered prefix is encountered.

Declaration
public Guid SetUnregisteredPrefixCategory(string category)
Parameters
Type Name Description
System.String category

The name of the category being to set.

Returns
Type Description
System.Guid

The guid of the category.

Remarks

If the category isn't already registered, it will register it will be registered.

View Source

StartAsync(CancellationToken)

Declaration
public Task StartAsync(CancellationToken cancellationToken)
Parameters
Type Name Description
System.Threading.CancellationToken cancellationToken
Returns
Type Description
System.Threading.Tasks.Task
View Source

StopAsync(CancellationToken)

Declaration
public Task StopAsync(CancellationToken cancellationToken)
Parameters
Type Name Description
System.Threading.CancellationToken cancellationToken
Returns
Type Description
System.Threading.Tasks.Task
View Source

ToggleLoggingPrefix(PrefixConfiguration, ISettingsManager)

Called when user toggles an option in the filter menu and saves the result.

Declaration
public void ToggleLoggingPrefix(PrefixConfiguration prefix, ISettingsManager settingManager)
Parameters
Type Name Description
PrefixConfiguration prefix

The specific prefix the user selected.

ISettingsManager settingManager
View Source

UnregisterPrefix(String)

Unregisters a prefix with the log manager.

Declaration
public void UnregisterPrefix(string prefix)
Parameters
Type Name Description
System.String prefix

The prefix to unregister.

Events

View Source

RegisteredCategoriesChanged

Event to track when the registered categories have changed.

Declaration
public event EventHandler RegisteredCategoriesChanged
Event Type
Type Description
System.EventHandler
View Source

RegisteredPrefixesChanged

Event to track when the registered prefixes have changed.

Declaration
public event EventHandler RegisteredPrefixesChanged
Event Type
Type Description
System.EventHandler

Implements

IPhoenixLogger
IHostedService
  • View Source
In This Article
Back to top Generated by DocFX