logger library

Provides a modern, high-performance logging framework with built-in strategies for console, Sentry, and other analytics integration.

This library is designed to facilitate easy and structured logging across different platforms and services, encapsulating complexity within pre-defined strategies. It's suitable for applications that need robust logging capabilities with minimal setup, including error tracking and performance monitoring.

Features:

  • Isolate-based processing for heavy operations
  • Performance monitoring and metrics
  • Modern console formatting with colors and emojis
  • Compatibility with popular logger packages
  • Async queue with backpressure control

Classes

AIAnalysisResult
AI Analysis Result
AIInsight
AI Insight
AILogEntry
AI Log Entry for structured logging
AILogStrategy
AI Log Strategy for Strategic Logger
CompressedLogBatch
Compressed Log Batch
CompressedLogEntry
Compressed Log Entry
CompressibleLogEntry
Compressible Log Entry
ConsoleLogEvent
A subclass of LogEvent specifically tailored for logging events to the console.
ConsoleLogStrategy
A LogStrategy implementation that logs messages, errors, and fatal errors to the console.
DatadogLogEvent
A specialized log event for Datadog logging strategy.
DatadogLogStrategy
A LogStrategy implementation that sends logs to Datadog.
FirebaseAnalyticsLogEvent
A subclass of LogEvent designed for integration with Firebase Analytics.
FirebaseAnalyticsLogStrategy
A LogStrategy implementation that utilizes Firebase Analytics to log events, errors, and fatal incidents.
FirebaseCrashlyticsLogEvent
A subclass of LogEvent that encapsulates data specific to Firebase Crashlytics logging.
FirebaseCrashlyticsLogStrategy
A LogStrategy implementation that logs messages and errors to Firebase Crashlytics.
LogCompression
Log Compression for Strategic Logger
LogCompressionStats
Log Compression Statistics
LogEntry
Pooled LogEntry implementation
LogEvent
A base class for creating log events, encapsulating information that can be logged.
MCPLogEntry
MCP Log Entry for structured logging
MCPLogStrategy
MCP Log Strategy for Strategic Logger
MCPQuery
MCP Query for advanced log filtering
MCPServer
Model Context Protocol (MCP) Server for Strategic Logger
ModernConsoleFormatter
Modern console formatter with colors, emojis, and structured output
NewRelicLogEvent
A specialized log event for New Relic logging strategy.
NewRelicLogStrategy
A LogStrategy implementation that sends logs to New Relic.
ObjectPool
Object Pool for Strategic Logger
ObjectPoolStats
Object Pool Statistics
SentryLogEvent
A subclass of LogEvent that encapsulates data specific to Sentry logging.
SentryLogStrategy
A LogStrategy implementation that logs messages and errors to Sentry.
StrategicLogger
StrategicLoggerCompatibilityWrapper
Compatibility wrapper that implements popular logger interfaces

Enums

AIInsightType
AI Insight Type
LogLevel
Defines the severity levels for logging throughout the application.

Extensions

StrategicLoggerSyncCompatibility on StrategicLogger
Synchronous compatibility methods for StrategicLogger

Properties

logger StrategicLogger
A flexible and centralized logger that supports multiple logging strategies.
getter/setter pair
loggerCompatibility StrategicLoggerCompatibilityWrapper
Global compatibility wrapper instance
final
modernConsoleFormatter ModernConsoleFormatter
Global modern console formatter instance
final

Exceptions / Errors

AlreadyInitializedError
An error indicating that an attempt was made to initialize an object that has already been initialized.
NotInitializedError
An error indicating that an attempt was made to use an object that has not yet been initialized.