|
EasySave v3.0
|
DailyLogWriter is responsible for writing log entries to daily log files in JSON format. Each daily file contains a single JSON array with one object per log entry. More...
Public Member Functions | |
| DailyLogWriter (string baseDirectory) | |
| Initializes a new instance of the DailyLogWriter class. | |
| DailyLogWriter (Func< string > getBaseDirectory) | |
| Initializes a new instance with a delegate to resolve the log directory at runtime. Used when the path can change (e.g. GUI changing base path without losing data). | |
| async Task | WriteAllTextAsync< T > (T logEntry, CancellationToken cancellationToken) |
| Writes the specified log entry asynchronously to a daily log file in JSON array format. The file name is determined from UTC date (format: yyyy-MM-dd.json). | |
| Task | WriteAllTextAsync< T > (T logEntry) |
| Compatibility overload: write without providing a CancellationToken. | |
| void | Dispose () |
| Disposes resources used by the writer. | |
DailyLogWriter is responsible for writing log entries to daily log files in JSON format. Each daily file contains a single JSON array with one object per log entry.
| EasyLog.DailyLogWriter.DailyLogWriter | ( | string | baseDirectory | ) |
Initializes a new instance of the DailyLogWriter class.
| baseDirectory | Base directory where daily log files will be stored. |
| EasyLog.DailyLogWriter.DailyLogWriter | ( | Func< string > | getBaseDirectory | ) |
Initializes a new instance with a delegate to resolve the log directory at runtime. Used when the path can change (e.g. GUI changing base path without losing data).
| getBaseDirectory | Delegate returning the current log directory. |
| async Task EasyLog.DailyLogWriter.WriteAllTextAsync< T > | ( | T | logEntry, |
| CancellationToken | cancellationToken ) |
Writes the specified log entry asynchronously to a daily log file in JSON array format. The file name is determined from UTC date (format: yyyy-MM-dd.json).
Implements EasyLog.ILogWriter.