Added detailed README files for the root AyCode.Core library and each major subfolder (Compression, Consts, Enums, Extensions, Helpers, Interfaces, Loggers). Each README outlines folder purpose, key files, APIs, and critical notes, with tables and architecture diagrams where relevant. Included explicit instructions for LLM-based maintenance. This greatly improves project documentation and developer onboarding. |
||
|---|---|---|
| .. | ||
| AcConsoleLogWriter.cs | ||
| AcLogWriterBase.cs | ||
| AcLoggerAdapter.cs | ||
| AcLoggerBase.cs | ||
| AcTextLogWriterBase.cs | ||
| IAcLogItemClient.cs | ||
| IAcLogWriterBase.cs | ||
| IAcLogWriterClientBase.cs | ||
| IAcLoggerBase.cs | ||
| LogLevel.cs | ||
| README.md | ||
README.md
Loggers
Custom logging framework with Microsoft.Extensions.Logging integration. Supports multiple output writers, colored console output, and structured log formatting.
Architecture
IAcLoggerBase (: IAcLogWriterBase, ILogger)
└─ AcLoggerBase (abstract, delegates to writers)
└─ [concrete loggers per app]
IAcLogWriterBase
└─ AcLogWriterBase (abstract, config from appsettings)
└─ AcTextLogWriterBase (abstract, text formatting)
└─ AcConsoleLogWriter (colored console output)
Key Files
Logger Core
IAcLoggerBase.cs— Unified interface combiningIAcLogWriterBase+ILogger. ExposesGetWritersandWriter<T>().AcLoggerBase.cs— Abstract logger implementingILogger. Manages a list ofIAcLogWriterBasewriters. Maps MSLogLeveltoAcLogLevel. Reads writer config fromappsettings.json(AyCode:Logger:LogWriters).AcLoggerAdapter.cs—AcLoggerProvider<TLogger>implementingILoggerProviderfor DI integration. Extension methods:AddAcLogger<T>(),UseOnlyAcLogger<T>().
Writers
IAcLogWriterBase.cs— Writer contract:Detail(),Debug(),Info(),Warning(),Suggest(),Error(),Write().IAcLogWriterClientBase.cs— Marker interface for client-side writers.AcLogWriterBase.cs— Abstract base with config loading from appsettings.AcTextLogWriterBase.cs— Abstract text formatter. Output format:[TIME] [APP] [LEVEL] [CATEGORY->METHOD] [THREADID] TEXT [ERROR].AcConsoleLogWriter.cs— Colored console writer (Gray=Trace, Cyan=Suggest, Yellow=Warning, Red=Error). Thread-safe via lock.
Supporting
IAcLogItemClient.cs— Structured log item DTO for remote transmission.LogLevel.cs— Byte enum: Detail(0), Trace(5), Debug(10), Info(15), Suggest(17), Warning(20), Error(25), Disabled(255). Must match the database LogLevel table.
LLM Maintenance: If you modify code in this folder, update this README to reflect the changes. If you notice the README content does not match the current code, automatically update the README to match the code.