Skip to content

gaslamp


Function: clearLogs()

clearLogs(): void

Clears all logs from the global singleton logger.

Use with caution as this removes all accumulated logs from the entire application. Typically used for testing or when starting a new logging session.

Returns

void

Since

0.42.0

Example

TypeScript
const logger = getLogger();
logger.info('First message');

clearLogs();

// Logger is reset (empty), previous logs are lost
logger.info('Second message');