Skip to main content
ErrorLog extends BeagleLog to provide specialized handling for JavaScript errors and exceptions. It automatically sets the log level to 'error' and extracts error messages.

Properties

Inherits all properties from BeagleLog, plus:
unknown
required
The original error object or value that was logged. Can be an Error instance, string, or any other value.

Constructor

unknown
required
The error to log. Can be an Error object, string, or any other value.
Behavior:
  • If error is an Error instance, uses error.message as the log message
  • Otherwise, converts the error to a string using String(error)
  • Automatically sets level to 'error'
  • Stores the original error in the error property

Usage Examples

Logging an Error Object

Logging a String Error

Logging Custom Error Types

Accessing the Original Error

Type Definition