/

Reset Configuration

The ByteHide Logger provides the ability to reset its configuration to defaults or reinitialize with new settings.

Basic Reset

import { Log } from '@bytehide/logger';

// Configure logger
Log.configure({
    minimumLevel: 'debug',
    consoleEnabled: true,
    persist: true
});

Log.info('Before reset');

// Reset to defaults
Log.reset();

Log.info('After reset');

Reset with New Configuration

// Reset and immediately reconfigure
Log.reset({
    minimumLevel: 'info',
    consoleEnabled: true,
    persist: false
});

Log.info('Logger reset and reconfigured');

Reset Types

Configuration Only

// Reset configuration but preserve context
Log.resetConfiguration();

Context Only

// Reset context but preserve configuration
Log.resetContext();

Complete Reset

// Reset everything (configuration + context)
Log.reset();

Common Use Cases

Testing

beforeEach(() => {
    // Reset logger before each test
    Log.reset({
        minimumLevel: 'debug',
        consoleEnabled: false
    });
});

Environment Switching

// Switch from development to production
Log.reset({
    minimumLevel: 'warn',
    consoleEnabled: false,
    persist: true
});
Previous
Enable/Disable Logging