Skip to main content
BeagleLog is the abstract base class that all log types extend. It provides core functionality for log entries including identification, timestamps, messages, and filtering.

Properties

string
required
Unique identifier for the log entry. Auto-generated using nanoid(6) if not provided.
Date
required
Timestamp when the log was created. Automatically set to new Date() during construction.
string
required
The log message content.
LogLevel
default:"info"
The severity level of the log. Can be one of: 'loading', 'info', 'warning', 'error', or 'success'.

Constructor

string
required
The log message content.
LogLevel
default:"info"
Optional severity level. One of: 'loading' | 'info' | 'warning' | 'error' | 'success'.
string
Optional custom ID. If not provided, a unique 6-character ID is generated automatically.

Methods

filter()

Filters the log based on a search query.
string
required
The search query to filter by.
Returns: boolean - true if the log’s message contains the query (case-insensitive), false otherwise.

Type Definitions