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.
1.8 KiB
1.8 KiB
GameCult.Logging
GameCult.Logging provides a common logging contract for cache, networking, and Unity-facing code.
Scope
This package provides a minimal logging abstraction. It does not provide structured logging, external sinks, scopes, or framework integration.
It is designed for:
- simple runtime diagnostics
- lightweight library dependencies
- swapping logging behavior by environment
- avoiding a hard dependency on a specific logging ecosystem
Included Types
ILogger: interface withLogInfo,LogWarning,LogError, andLogDebugNullLogger: no-op implementationConsoleLogger: writes toSystem.ConsoleFileLogger: appends timestamped log lines to a fileUnityLogger: Unity-specific implementation insrc/GameCult.Logging.Unity
Behavior Notes
NullLoggeris the safe default used by other libraries when no logger is supplied.ConsoleLoggercolors warnings and errors.FileLoggerwrites plain text entries with timestamps.UnityLoggerschedules logging to the next Unity frame instead of writing immediately.
Typical Usage
using GameCult.Logging;
ILogger logger = new ConsoleLogger();
logger.LogInfo("Server starting");
logger.LogWarning("High latency detected");
logger.LogError("Connection failed");
Swapping Implementations
Consumers can choose the implementation that fits the runtime.
using GameCult.Logging;
using GameCult.Networking;
var client = new Client
{
Logger = new FileLogger("client.log")
};
client.Connect("127.0.0.1", 3075);
When To Use Something Else
If you need:
- structured events
- sinks to external observability platforms
- log scopes
- sampling and filtering pipelines
- JSON log output
use a logging framework at the application boundary.