Interface IPhoenixLogger
Interface for application level logging.
Namespace: Phoenix.Logger
Assembly: Phoenix.Abstractions.Logger.dll
Syntax
public interface IPhoenixLogger
Properties
View SourceRegisteredCategories
Gets the list of registered categories.
Declaration
ReadOnlyCollection<LogCategoryInfo> RegisteredCategories { get; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.ReadOnlyCollection<LogCategoryInfo> |
RegisteredPrefixes
Gets the list of registered prefixes.
Declaration
ReadOnlyCollection<PrefixConfiguration> RegisteredPrefixes { get; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.ReadOnlyCollection<PrefixConfiguration> |
Methods
View SourceGetRegisteredCategoryById(Guid)
Gets the category info for a registered category.
Declaration
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. |
GetRegisteredCategoryByName(String)
Gets the category info for a registered category.
Declaration
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. |
IsPrefixRegistered(String)
Checks if a prefix is registered with this logger.
Declaration
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. |
Log(String, LogSeverity, String, Object[])
Logs data to any and all active loggers.
Declaration
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. |
Log(String, Guid, LogSeverity, String, Object[])
Logs data to any and all active loggers.
Declaration
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. |
Log(String, Guid, String, Object[])
Logs data to any and all active loggers.
Declaration
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. |
Log(String, String, Object[])
Logs data to any and all active loggers.
Declaration
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. |
LogCriticalException(String, Exception)
Logs a top-level exception object to all active loggers as a Critical severity.
Declaration
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. |
LogCriticalException(String, Exception, Boolean)
Logs an exception object to all active loggers as a Critical severity.
Declaration
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 |
LogException(String, LogSeverity, Exception)
Logs a top-level exception object to all active loggers.
Declaration
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. |
LogException(String, LogSeverity, Exception, Boolean)
Logs an exception object to all active loggers.
Declaration
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 |
Logline(String, LogSeverity, String, Object[])
Logs data to all active loggers and includes a line break at the end.
Declaration
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. |
Logline(String, Guid, LogSeverity, String, Object[])
Logs data to all active loggers and includes a line break at the end.
Declaration
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. |
Logline(String, Guid, String, Object[])
Logs data to all active loggers and includes a line break at the end.
Declaration
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. |
Logline(String, String, Object[])
Logs data to all active loggers and includes a line break at the end.
Declaration
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. |
RegisterCategory(String)
Registers a category with a default severity and color for the output window.
Declaration
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 category. |
RegisterOutputHandler(Action<Guid, String, LogSeverity, Color>, LogSeverity[])
Registers a handler function with the logger.
Declaration
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. |
RegisterPrefix(String, LogSeverity, Guid, Color, Boolean)
Registers a prefix with the log manager.
Declaration
void RegisterPrefix(string prefix, LogSeverity defaultSeverity, Guid defaultCategoryId, Color textColor, bool showPrefix)
Parameters
Type | Name | Description |
---|---|---|
System.String | prefix | The string prefix. |
LogSeverity | defaultSeverity | The default category to log to when using this prefix. |
System.Guid | defaultCategoryId | The id of the category to log to when using this prefix. |
System.Windows.Media.Color | textColor | The text color of this prefix. |
System.Boolean | showPrefix | True to show prefix, false otherwise. |
SetHandlerSeverities(Guid, LogSeverity[])
Sets the severity types that this handler wants to receive.
Declaration
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. |
SetUnregisteredPrefixCategory(String)
Sets the category to log with when an unregistered prefix is encountered.
Declaration
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 be registered.
UnregisterPrefix(String)
Unregisters a prefix with the log manager.
Declaration
void UnregisterPrefix(string prefix)
Parameters
Type | Name | Description |
---|---|---|
System.String | prefix | The prefix to unregister. |
Events
View SourceRegisteredCategoriesChanged
Event to track when the registered categories have changed.
Declaration
event EventHandler RegisteredCategoriesChanged
Event Type
Type | Description |
---|---|
System.EventHandler |
RegisteredPrefixesChanged
Event to track when the registered prefixes have changed.
Declaration
event EventHandler RegisteredPrefixesChanged
Event Type
Type | Description |
---|---|
System.EventHandler |