|
|
@@ -1,15 +1,28 @@
|
|
|
// Copyright (c) The Perspex Project. All rights reserved.
|
|
|
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
|
|
|
|
|
-using System;
|
|
|
using System.Runtime.CompilerServices;
|
|
|
|
|
|
namespace Perspex.Logging
|
|
|
{
|
|
|
+ /// <summary>
|
|
|
+ /// Logs perspex messages.
|
|
|
+ /// </summary>
|
|
|
public static class Logger
|
|
|
{
|
|
|
+ /// <summary>
|
|
|
+ /// Gets or sets the application-defined sink that recieves the messages.
|
|
|
+ /// </summary>
|
|
|
public static ILogSink Sink { get; set; }
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// Logs an event.
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="level">The log event level.</param>
|
|
|
+ /// <param name="area">The area that the event originates.</param>
|
|
|
+ /// <param name="source">The object from which the event originates.</param>
|
|
|
+ /// <param name="messageTemplate">The message template.</param>
|
|
|
+ /// <param name="propertyValues">The message property values.</param>
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
|
public static void Log(
|
|
|
LogEventLevel level,
|
|
|
@@ -21,6 +34,13 @@ namespace Perspex.Logging
|
|
|
Sink?.Log(level, area, source, messageTemplate, propertyValues);
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// Logs an event with the <see cref="LogEventLevel.Verbose"/> level.
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="area">The area that the event originates.</param>
|
|
|
+ /// <param name="source">The object from which the event originates.</param>
|
|
|
+ /// <param name="messageTemplate">The message template.</param>
|
|
|
+ /// <param name="propertyValues">The message property values.</param>
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
|
public static void Verbose(
|
|
|
string area,
|
|
|
@@ -31,6 +51,13 @@ namespace Perspex.Logging
|
|
|
Log(LogEventLevel.Verbose, area, source, messageTemplate, propertyValues);
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// Logs an event with the <see cref="LogEventLevel.Debug"/> level.
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="area">The area that the event originates.</param>
|
|
|
+ /// <param name="source">The object from which the event originates.</param>
|
|
|
+ /// <param name="messageTemplate">The message template.</param>
|
|
|
+ /// <param name="propertyValues">The message property values.</param>
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
|
public static void Debug(
|
|
|
string area,
|
|
|
@@ -41,6 +68,13 @@ namespace Perspex.Logging
|
|
|
Log(LogEventLevel.Debug, area, source, messageTemplate, propertyValues);
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// Logs an event with the <see cref="LogEventLevel.Information"/> level.
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="area">The area that the event originates.</param>
|
|
|
+ /// <param name="source">The object from which the event originates.</param>
|
|
|
+ /// <param name="messageTemplate">The message template.</param>
|
|
|
+ /// <param name="propertyValues">The message property values.</param>
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
|
public static void Information(
|
|
|
string area,
|
|
|
@@ -51,6 +85,13 @@ namespace Perspex.Logging
|
|
|
Log(LogEventLevel.Information, area, source, messageTemplate, propertyValues);
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// Logs an event with the <see cref="LogEventLevel.Warning"/> level.
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="area">The area that the event originates.</param>
|
|
|
+ /// <param name="source">The object from which the event originates.</param>
|
|
|
+ /// <param name="messageTemplate">The message template.</param>
|
|
|
+ /// <param name="propertyValues">The message property values.</param>
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
|
public static void Warning(
|
|
|
string area,
|
|
|
@@ -61,6 +102,13 @@ namespace Perspex.Logging
|
|
|
Log(LogEventLevel.Warning, area, source, messageTemplate, propertyValues);
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// Logs an event with the <see cref="LogEventLevel.Error"/> level.
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="area">The area that the event originates.</param>
|
|
|
+ /// <param name="source">The object from which the event originates.</param>
|
|
|
+ /// <param name="messageTemplate">The message template.</param>
|
|
|
+ /// <param name="propertyValues">The message property values.</param>
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
|
public static void Error(
|
|
|
string area,
|
|
|
@@ -71,6 +119,13 @@ namespace Perspex.Logging
|
|
|
Log(LogEventLevel.Error, area, source, messageTemplate, propertyValues);
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// Logs an event with the <see cref="LogEventLevel.Fatal"/> level.
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="area">The area that the event originates.</param>
|
|
|
+ /// <param name="source">The object from which the event originates.</param>
|
|
|
+ /// <param name="messageTemplate">The message template.</param>
|
|
|
+ /// <param name="propertyValues">The message property values.</param>
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
|
public static void Fatal(
|
|
|
string area,
|