AyCode.Core/AyCode.Core/Loggers
Loretta e606cd171b Add comprehensive README docs for all core subfolders
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.
2026-03-28 16:24:03 +01:00
..
AcConsoleLogWriter.cs improvements 2025-10-21 15:15:15 +02:00
AcLogWriterBase.cs Logger improvements 2025-10-23 06:35:32 +02:00
AcLoggerAdapter.cs Integrate AcLogger with Microsoft.Extensions.Logging 2026-01-09 11:12:35 +01:00
AcLoggerBase.cs Add Toon serializer: LLM-optimized format & rich metadata 2026-01-10 20:13:54 +01:00
AcTextLogWriterBase.cs fix 2024-05-19 08:05:16 +02:00
IAcLogItemClient.cs refactroing, improvements, fixes, etc... 2024-05-18 05:12:23 +02:00
IAcLogWriterBase.cs Implement ConditionalLog to Logger 2024-05-19 13:17:13 +02:00
IAcLogWriterClientBase.cs AcSignalRClient; AcBrowserLogWriter... 2025-09-01 16:19:01 +02:00
IAcLoggerBase.cs Integrate AcLogger with Microsoft.Extensions.Logging 2026-01-09 11:12:35 +01:00
LogLevel.cs Add Logger 2024-05-14 13:04:01 +02:00
README.md Add comprehensive README docs for all core subfolders 2026-03-28 16:24:03 +01:00

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 combining IAcLogWriterBase + ILogger. Exposes GetWriters and Writer<T>().
  • AcLoggerBase.cs — Abstract logger implementing ILogger. Manages a list of IAcLogWriterBase writers. Maps MS LogLevel to AcLogLevel. Reads writer config from appsettings.json (AyCode:Logger:LogWriters).
  • AcLoggerAdapter.csAcLoggerProvider<TLogger> implementing ILoggerProvider for 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.