Skip to content

Commit 1d5e8dc

Browse files
author
LoneWandererProductions
committed
add some smaller fixes
1 parent 95ffdec commit 1d5e8dc

2 files changed

Lines changed: 21 additions & 11 deletions

File tree

CoreMemoryLog/InMemoryLogger.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -354,13 +354,18 @@ public bool IsEnabled(LogLevel logLevel) =>
354354

355355
/// <inheritdoc />
356356
/// <summary>
357-
/// Checks if the given <paramref name="logLevel" /> is enabled.
357+
/// Checks if the given Microsoft log level is enabled based on the current internal LogLevel.
358358
/// </summary>
359-
/// <param name="logLevel">Level to be checked.</param>
359+
/// <param name="logLevel">The log level.</param>
360360
/// <returns>
361-
/// <see langword="true" /> if enabled.
361+
/// <c>true</c> if the specified log level is enabled; otherwise, <c>false</c>.
362362
/// </returns>
363-
public bool IsEnabled(Microsoft.Extensions.Logging.LogLevel logLevel) => true;
363+
public bool IsEnabled(Microsoft.Extensions.Logging.LogLevel logLevel)
364+
{
365+
// Convert MS LogLevel to your internal LogLevel (assuming they align)
366+
// and check against your set threshold.
367+
return (LogLevel)logLevel >= LogLevel;
368+
}
364369

365370
/// <summary>
366371
/// Logs the specified log level.

CoreMemoryLog/LogLevel.cs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,38 @@ namespace CoreMemoryLog
1414
public enum LogLevel
1515
{
1616
/// <summary>
17-
/// The trace
17+
/// The trace level, used for very fine-grained debugging messages that are typically only relevant during development and debugging sessions, such as rendering loops, memory allocators, or ECS pipelines.
1818
/// </summary>
1919
Trace = 0,
2020

2121
/// <summary>
22-
/// The debug
22+
/// The debug level, used for detailed debugging messages that are typically only relevant during development and debugging sessions.
2323
/// </summary>
2424
Debug = 1,
2525

2626
/// <summary>
27-
/// The information
27+
/// The information level, used for general informational messages that highlight the progress of the application at a coarse-grained level.
2828
/// </summary>
2929
Information = 2,
3030

3131
/// <summary>
32-
/// The warning
32+
/// The warning level, used for potentially harmful situations that may require attention but do not necessarily indicate application failure.
3333
/// </summary>
3434
Warning = 3,
3535

3636
/// <summary>
37-
/// The error
37+
/// The error level, used for recoverable errors that may require attention but do not necessarily indicate application failure.
3838
/// </summary>
3939
Error = 4,
4040

4141
/// <summary>
42-
/// The critical
42+
/// The critical level, used for severe errors that may cause application failure.
4343
/// </summary>
44-
Critical = 5
44+
Critical = 5,
45+
46+
/// <summary>
47+
/// The none level, used to disable logging.
48+
/// </summary>
49+
None = 6
4550
}
4651
}

0 commit comments

Comments
 (0)