# @agent-infra/logger Browser Example

## Output

Check your browser's console (F12 or right-click > Inspect > Console)

## Code Snippet

    import { ConsoleLogger } from '../dist/index.mjs';

    // Create a logger instance
    const logger = new ConsoleLogger('[Browser]');

    // Basic logging
    logger.info('This is an info message');
    logger.warn('This is a warning message');
    logger.error('This is an error message');
    logger.success('This is a success message');

    // Logging with data
    logger.infoWithData('User data:',
      { id: 1, name: 'John', email: 'john@example.com' },
      (user) => ({ ...user, email: '***@example.com' })
    );

    // Hierarchical logging
    const apiLogger = logger.spawn('API');
    apiLogger.info('API request received');