|
Asper Header
1.0.14
The header injector extension
|
Primary logging controller with dual-channel output and caller identification. More...

Public Member Functions | |
| constructor (context:vscode.ExtensionContext|undefined=undefined, fullyLoaded:boolean=false) | |
| Initializes the logging system with environment detection and auto-display. | |
| updateInitialisationStatus (extensionLoaded:boolean=true) | |
| Updates the initialization status and manages output channel lifecycle. | |
| info (message:string, searchDepth:number|undefined=undefined) | |
| Logs informational messages with automatic caller identification. | |
| warning (message:string, searchDepth:number|undefined=undefined) | |
| Records warning conditions requiring attention but not blocking execution. | |
| error (message:string, searchDepth:number|undefined=undefined) | |
| Records critical errors requiring immediate attention or investigation. | |
| debug (message:string, searchDepth:number|undefined=undefined) | |
| Generates detailed debugging information when debug mode is enabled. | |
Data Fields | |
| Gui | : Gui = new Gui(this.LI) |
| GUI notification logger instance for user-facing messages. | |
Primary logging controller with dual-channel output and caller identification.
Serves as the main logging interface for the extension, providing both console output for developers and VS Code output panel integration. Features automatic caller identification, intelligent environment adaptation, and comprehensive formatting for optimal debugging and monitoring experiences.
Architecture Integration:
Output Channel Management: Creates and manages a dedicated VS Code output panel ("OUTPUT" tab) for the extension, providing structured log viewing separate from the debug console. This enables users to review extension activity without developer tools access.
Environment Adaptation: Intelligently adapts logging behavior based on extension execution environment:
Caller Identification System:
Performance Optimizations:
Thread Safety: All logging operations are synchronous and atomic within VS Code's JavaScript environment. No additional synchronization primitives required.
Integration Points:
|
inline |
Initializes the logging system with environment detection and auto-display.
| context | Optional VS Code extension context for environment detection |
Sets up the complete logging infrastructure including utility instances, GUI integration, output channel creation, and environment-specific behavior. The context parameter enables intelligent adaptation to development vs production environments.
Development Mode Features:
Production Mode Features:
|
inline |
Generates detailed debugging information when debug mode is enabled.
| message | Debug message with detailed development information |
| searchDepth | Optional stack depth override for complex calling scenarios |
Produces verbose debugging output for development and troubleshooting scenarios. All debug output is conditionally generated based on extension configuration, ensuring zero performance impact in production when debug mode is disabled.
Output Format: ‘[timestamp] ExtensionName DEBUG: <CallerFunction> 'message’`
Debug Content Guidelines:
Conditional Behavior: Debug messages are completely bypassed when debug mode is disabled, including message formatting and caller identification overhead. This ensures optimal performance in production environments.
Output Destinations:
Debug Console Integration: Uses console.debug() in development environments for specialized debug styling and filtering capabilities. Most browser developer tools allow filtering by log level, making debug messages easy to isolate during troubleshooting.
Note: This method always outputs to the panel but console output depends on installation state, not debug configuration. Debug filtering occurs at the GUI notification level (Gui.debug method) rather than console level.
|
inline |
Records critical errors requiring immediate attention or investigation.
| message | Error description detailing failure conditions and context |
| searchDepth | Optional stack depth override for complex calling scenarios |
Generates error-level log entries for critical failures, exceptions, and conditions that prevent normal operation. Uses console.error() for proper browser console styling and error tracking integration.
Output Format: ‘[timestamp] ExtensionName ERROR: <CallerFunction> 'message’`
Error Categories:
Output Destinations:
Console Error Styling: Error messages use console.error() in development environments, providing red styling and stack trace integration for immediate developer attention. Production environments rely on output panel and GUI notifications instead.
Integration: Error logs are typically paired with GUI error notifications to ensure users are informed of critical issues requiring their attention, regardless of the console output availability.
|
inline |
Logs informational messages with automatic caller identification.
| message | Information message describing successful operations or status updates |
| searchDepth | Optional stack depth override for complex calling scenarios |
Generates comprehensive informational log entries with full context attribution. Suitable for tracking normal operation flow, successful completions, and non-critical status updates that aid in debugging and monitoring.
Output Format: ‘[timestamp] ExtensionName INFO: <CallerFunction> 'message’`
Output Destinations:
Console Output Logic: Console output is enabled only in development and test environments (when extensionInstalled = false) to provide real-time debugging feedback without cluttering the console in production user environments.
Caller Identification: Automatically resolves the calling function name using stack trace analysis. The searchDepth parameter allows adjustment for wrapper functions or complex call chains where the default depth doesn't capture the desired caller.
|
inline |
Updates the initialization status and manages output channel lifecycle.
| extensionLoaded | Boolean indicating if the extension is fully loaded and operational |
Manages the complete lifecycle of the logging system's output infrastructure based on extension initialization state. This method coordinates output channel creation/disposal, GUI notification availability, and development environment auto-display behavior.
Initialization Sequence (extensionLoaded = true):
Shutdown Sequence (extensionLoaded = false):
Resource Management:
State Coordination: Ensures both Log and Gui classes maintain synchronized initialization state, preventing inconsistent behavior between console logging and GUI notifications.
Updates installation state for dynamic environment changes with UI adaptation
| context | Updated VS Code extension context |
Allows runtime updates to the installation state detection, useful when the extension context becomes available after initial logger creation or when the execution environment changes during extension lifecycle.
Dynamic UI Adaptation: When switching to development mode (extensionInstalled = false), automatically displays the VS Code output panel to provide immediate visibility of log output. This ensures developers have instant access to debugging information when the environment context changes during extension execution.
Use Cases:
|
inline |
Records warning conditions requiring attention but not blocking execution.
| message | Warning description of potential issues or unusual conditions |
| searchDepth | Optional stack depth override for complex calling scenarios |
Generates warning-level log entries for conditions that may require attention but don't prevent continued operation. Includes automatic caller attribution and uses console.warn() for appropriate browser console styling.
Output Format: ‘[timestamp] ExtensionName WARNING: <CallerFunction> 'message’`
Use Cases:
Output Destinations:
Console Output Behavior: Warning messages are sent to console.warn() only in development and test environments to maintain clean console output in production while providing appropriate styling (yellow color) for developer attention during debugging.
| Gui Log::__pad2__ |