2.1 KiB
2.1 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |
|---|---|---|---|---|---|
|
2026-04-17T16:14:40.267853+00:00 | zai-org/GLM-5-FP8 | 1 | 60dc472c9df3ec54 |
Logging
Purpose
This module provides centralized logging infrastructure for the DbAPI system. It wraps a TextLogger to write timestamped, categorized log messages to a file named "DB.log" with support for log rotation, filtering by severity level, and thread-safe initialization. The module exposes a delegate-based sink (DBAPILogWriter) that can be used by other components to write raw log messages.
Public Interface
LogManager (internal class)
static Sink DBAPILogWriter- Public field assigned to the internalLogMsgmethod; allows external code to write raw strings to the log.enum LogEvents- Public enum defining log event categories:Message,Connections,Login,Information,DataRecorders,Graphs,CalculatedChannels,Sensors,TestSetups,RegionsOfInterest,Tags.static void Initialize(int logSize, string path, int minLog)- Initializes the logger with the specified file size limit, directory path, and minimum log level filter. Creates "DB.log" in the given path. Thread-safe; subsequent calls are no-ops if already initialized.static void Log(TraceEventType eventType, LogEvents logEvent, string msg)- Logs a message with the specified event type and category. Respects the_MinLogfilter; messages whose event type is not in the filter are silently dropped.static void OnWriteException(Exception ex)- Callback for handling write exceptions; writes the exception message toConsole.Error.
Invariants
_LogWriteris singleton-initialized; once set,Initializereturns immediately without reinitializing.- Initialization is guarded by
lock(MyLock)for thread safety. _MinLogdefaults to(TraceEventType.Error | TraceEventType.Warning)ifInitializeis not called or ifminLogis not applied.- Log filtering uses bitwise AND: a message is logged only if
(_MinLog & (int)eventType) == (int)eventType.
Dependencies
- Depends on:
DTS.Common.Utilities.Logging(pro