Skip to content

Commit 4457732

Browse files
author
LoneWandererProductions
committed
clear up docu a bit
1 parent 230160b commit 4457732

3 files changed

Lines changed: 13 additions & 46 deletions

File tree

‎Core.MemoryLog/IInMemoryLogger.cs‎

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ namespace Core.MemoryLog
2020
/// </summary>
2121
public interface IInMemoryLogger
2222
{
23-
// ---------------------------------------------------------
24-
// Configuration
25-
// ---------------------------------------------------------
23+
// --- Configuration ---
2624

2725
/// <summary>
2826
/// Gets or sets the minimum log level for this logger.
@@ -35,15 +33,14 @@ public interface IInMemoryLogger
3533

3634
/// <summary>
3735
/// Gets or sets a value indicating whether [enable stack trace].
36+
/// Should be always false in production, as it can be expensive to capture stack traces for every log entry.
3837
/// </summary>
3938
/// <value>
4039
/// <c>true</c> if [enable stack trace]; otherwise, <c>false</c>.
4140
/// </value>
4241
bool EnableStackTrace { get; set; }
4342

44-
// ---------------------------------------------------------
45-
// Core logging
46-
// ---------------------------------------------------------
43+
// --- Core logging ---
4744

4845
/// <summary>
4946
/// Adds a log entry to the memory (this can be directly from logging operations).
@@ -63,9 +60,7 @@ void Log(LogLevel logLevel,
6360
[CallerMemberName] string callerMethod = "",
6461
params object[] args);
6562

66-
// ---------------------------------------------------------
67-
// Retrieval
68-
// ---------------------------------------------------------
63+
// --- Retrieval ---
6964

7065
/// <summary>
7166
/// Gets all logs from memory.
@@ -97,9 +92,7 @@ void Log(LogLevel logLevel,
9792
/// </summary>
9893
event EventHandler<LogEntry>? LogAdded;
9994

100-
// ---------------------------------------------------------
101-
// Persistence
102-
// ---------------------------------------------------------
95+
// --- Persistence ---
10396

10497
/// <summary>
10598
/// Dumps the in-memory logs to a file.
@@ -109,9 +102,7 @@ void Log(LogLevel logLevel,
109102
/// <param name="minimumLevel">Minimum level to include in the dump.</param>
110103
void DumpToFile(string filePath, bool append = false, LogLevel minimumLevel = LogLevel.Trace);
111104

112-
// ---------------------------------------------------------
113-
// Clearing
114-
// ---------------------------------------------------------
105+
// --- Clearing ---
115106

116107
/// <summary>
117108
/// Clears log entries from a specific library.

‎Core.MemoryLog/ILogger.cs‎

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,17 @@ namespace Core.MemoryLog
1717
/// </summary>
1818
public interface ILogger
1919
{
20-
// ---------------------------------------------------------
20+
2121
// Configuration
22-
// ---------------------------------------------------------
22+
2323

2424
/// <summary>
2525
/// Gets or sets the minimum log level for this logger.
2626
/// Messages below this level will be ignored.
2727
/// </summary>
2828
LogLevel LogLevel { get; set; }
2929

30-
// ---------------------------------------------------------
31-
// Core logging
32-
// ---------------------------------------------------------
30+
// --- Core logging ---
3331

3432
/// <summary>
3533
/// Logs a message with the specified <paramref name="level"/>.
@@ -40,9 +38,7 @@ public interface ILogger
4038
/// <param name="args">Optional arguments for message formatting.</param>
4139
void Log(LogLevel level, string? message, Exception? exception = null, params object[] args);
4240

43-
// ---------------------------------------------------------
44-
// Convenience shortcuts
45-
// ---------------------------------------------------------
41+
// --- Convenience shortcuts ---
4642

4743
/// <summary>
4844
/// Logs the debug.
@@ -79,9 +75,7 @@ public interface ILogger
7975
/// <param name="args">The arguments.</param>
8076
void LogError(string? message, params object[] args);
8177

82-
// ---------------------------------------------------------
83-
// Optional Microsoft.Extensions.Logging bridge
84-
// ---------------------------------------------------------
78+
// --- Optional Microsoft.Extensions.Logging bridge ---
8579

8680
/// <summary>
8781
/// Bridges to Microsoft.Extensions.Logging infrastructure.
@@ -92,9 +86,7 @@ void Log<TState>(Microsoft.Extensions.Logging.LogLevel logLevel,
9286
Exception? exception,
9387
Func<TState, Exception?, string> formatter);
9488

95-
// ---------------------------------------------------------
96-
// Persistence
97-
// ---------------------------------------------------------
89+
// --- Persistence ---
9890

9991
/// <summary>
10092
/// Writes the current log entries to a file.

‎Core.MemoryLog/InMemoryLogger.cs‎

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,9 @@ private InMemoryLogger() : this(1000) { }
6060
public LogLevel LogLevel { get; set; }
6161

6262
/// <inheritdoc />
63-
/// <summary>
64-
/// Gets or sets a value indicating whether [enable stack trace].
65-
/// </summary>
66-
/// <value>
67-
/// <c>true</c> if [enable stack trace]; otherwise, <c>false</c>.
68-
/// </value>
69-
public bool EnableStackTrace { get; set; }
63+
public bool EnableStackTrace { get; set; } = false;
7064

7165
/// <inheritdoc />
72-
/// <summary>
73-
/// Occurs when [log added].
74-
/// </summary>
7566
public event EventHandler<LogEntry>? LogAdded;
7667

7768
/// <summary>
@@ -104,10 +95,6 @@ private void EnqueueLog(string library, LogEntry entry)
10495
}
10596

10697
/// <inheritdoc />
107-
/// <summary>
108-
/// Core structured logging method.
109-
/// Stores the original template and args without formatting.
110-
/// </summary>
11198
public void Log(LogLevel level,
11299
string? message,
113100
string? libraryName = null,
@@ -152,9 +139,6 @@ public void Log(LogLevel level,
152139
}
153140

154141
/// <inheritdoc />
155-
/// <summary>
156-
/// Default ILogger log (uses "ILogger" as library).
157-
/// </summary>
158142
public void Log(LogLevel level, string? message, Exception? exception = null, params object[] args)
159143
=> Log(
160144
level,

0 commit comments

Comments
 (0)