JSON backing store, I/O fixes, Networking Security
Introduced Newtonsoft.Json-backed persistence. Improved backing-store reliability and serialization across the caching stack. Improved networking security posture. Key changes: - Add new GameCult.Caching.NewtonsoftJson project with SingleFile/MultiFile backing stores and polymorphic known-type envelopes. - Add MessagePack helper serialization (DatabaseEntrySerialization) and update MessagePack backing stores to use the shared options/resolver; add DatabaseLink formatter and generator/analyzer docs. - Update CultLib.sln to include the new projects and new caching tests project. - Improve CultCache persistence behavior: track pending store operations, wait for operations on PullAll, and centralize async push handling with error logging. - Harden file I/O in multi-file/single-file stores: atomic temp-file writes, safe Replace/Move semantics, rename-safe deletes, and improved file-watcher subscription and debounce disposal. - Add README files and documentation for several subprojects and packaging projects. These changes add JSON persistence support, improve serialization consistency, and make on-disk operations more robust and observable.
This commit is contained in:
parent
d88eecb4ba
commit
0bfc85a4f2
50 changed files with 3957 additions and 325 deletions
|
|
@ -3,10 +3,17 @@ using System.IO;
|
|||
|
||||
namespace GameCult.Logging
|
||||
{
|
||||
/// <summary>
|
||||
/// Appends timestamped log entries to a file on disk.
|
||||
/// </summary>
|
||||
public class FileLogger : ILogger
|
||||
{
|
||||
private readonly string _logPath;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new file-backed logger.
|
||||
/// </summary>
|
||||
/// <param name="logPath">The path to the log file to append to.</param>
|
||||
public FileLogger(string logPath = "server.log")
|
||||
{
|
||||
_logPath = logPath;
|
||||
|
|
@ -17,9 +24,16 @@ namespace GameCult.Logging
|
|||
File.AppendAllText(_logPath, $"[{DateTime.Now:yyyy-MM-dd HH:mm:ss}] [{level}] {message}\n");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void LogInfo(string message) => Append("INFO", message);
|
||||
|
||||
/// <inheritdoc />
|
||||
public void LogWarning(string message) => Append("WARN", message);
|
||||
|
||||
/// <inheritdoc />
|
||||
public void LogError(string message) => Append("ERROR", message);
|
||||
|
||||
/// <inheritdoc />
|
||||
public void LogDebug(string message) => Append("DEBUG", message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue