Skip to main content
MessageLog is the simplest log type, extending BeagleLog without any additional properties. Use it for general-purpose logging of informational messages.

Overview

MessageLog inherits all properties and methods from BeagleLog and doesn’t add any additional functionality. It’s the default choice for logging custom messages at various severity levels.

Constructor

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

When to Use

Use MessageLog for:
  • General application events
  • Custom debug messages
  • User action tracking
  • Application state changes
  • Any log that doesn’t fit the specific types (Error, Networking)

Usage Examples

Basic Info Message

import { MessageLog } from 'react-native-beagle';

const log = new MessageLog('User logged in successfully');

Success Message

const log = new MessageLog('Data saved to database', 'success');

Warning Message

const log = new MessageLog('API rate limit approaching', 'warning');

Custom ID

const log = new MessageLog(
  'Payment processed',
  'success',
  'payment-123'
);

Type Definition

class MessageLog extends BeagleLog {}

Build docs developers (and LLMs) love