Added category
This commit is contained in:
@@ -71,11 +71,18 @@ public abstract class BatchingLoggerProvider : ILoggerProvider, IDisposable
|
||||
|
||||
public bool IsStarted { get; set; }
|
||||
public bool UseMask { get; set; }
|
||||
public string Category { get; set; } = "General";
|
||||
|
||||
private LoggerSettings _loggerSettings;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new logger instance for the specified category name.
|
||||
/// </summary>
|
||||
/// <param name="categoryName">The category name for messages produced by the logger. Cannot be null.</param>
|
||||
/// <returns>An <see cref="ILogger"/> instance that logs messages for the specified category.</returns>
|
||||
public ILogger CreateLogger(string categoryName)
|
||||
{
|
||||
Category = categoryName;
|
||||
return new BatchingLogger(this, categoryName, LoggerSettings);
|
||||
}
|
||||
|
||||
|
||||
@@ -132,12 +132,7 @@ public static class LogHelper
|
||||
|
||||
|
||||
|
||||
internal static string FormatMessageWithHeader(
|
||||
LoggerSettings settings,
|
||||
ELogType logType,
|
||||
string message,
|
||||
DateTime dateTime,
|
||||
string category = null)
|
||||
internal static string FormatMessageWithHeader(LoggerSettings settings, ELogType logType, string message, DateTime dateTime, string category = null)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(message))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user