|
Asper Header
1.0.14
The header injector extension
|
Advanced dual-channel logging system for VS Code extension development. More...
Go to the source code of this file.
Data Structures | |
| class | LoggerInternals |
| Core utility infrastructure for logging operations and formatting. More... | |
| class | Gui |
| User-facing notification system for VS Code extension GUI integration. More... | |
| class | Log |
| Primary logging controller with dual-channel output and caller identification. More... | |
Variables | |
| import *as vscode from | vscode |
| import { CodeConfig } from "./processConfiguration" | |
| const | instance = new Log() |
| Singleton logger instance for application-wide use. | |
| export const | logger |
| Singleton logger instance providing unified logging interface for the entire extension. | |
| export type | LogType = Log |
| Type alias for Log class enabling dependency injection and testing. | |
Advanced dual-channel logging system for VS Code extension development.
This module implements a sophisticated logging infrastructure designed specifically for VS Code extensions, providing both console output for developers and GUI notifications for end users. The system features automatic caller identification, precise timestamping, configurable output channels, and intelligent debug mode handling.
Architecture Overview: The logging system employs a multi-class architecture with clear separation of concerns:
Key Features:
Output Channels:
Performance Optimizations:
Thread Safety: All logging operations are synchronous and thread-safe within VS Code's single-threaded JavaScript environment. No additional synchronization required.
Environment Behavior Summary:
Development Mode (F5 debugging, unpackaged):
Production Mode (installed from marketplace):
Usage Patterns:
Definition in file logger.ts.
| import { CodeConfig } from "./processConfiguration" |
| const instance = new Log() |
| export const logger |
Singleton logger instance providing unified logging interface for the entire extension.
Primary logging interface exported for application-wide use. This singleton instance ensures consistent logging behavior, formatting, and configuration across all extension modules while providing both developer-focused console output and user-facing GUI notifications.
Singleton Benefits:
Usage Patterns:
Output Destinations:
Thread Safety: Safe for use from any extension context without additional synchronization. All operations are synchronous and atomic within VS Code's event loop.
Type alias for Log class enabling dependency injection and testing.
Provides a TypeScript type alias for the Log class, facilitating dependency injection patterns, mock implementations for testing, and type-safe interfaces where logger instances need to be passed as parameters or stored as properties.
Use Cases:
Example Usage: