UNPKG

@livy/logger

Version:

A Monolog-inspired logging library for Node.js

32 lines (31 loc) 805 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AsyncLogger = void 0; const abstract_logger_1 = require("./abstract-logger"); /** * An asynchrous logger implementation */ class AsyncLogger extends abstract_logger_1.AbstractLogger { /** * @inheritdoc */ withName(name) { return new AsyncLogger(name, { handlers: this._handlers, processors: this._processors, timezone: this._timezone }); } /** * @inheritdoc */ async runHandlers(record) { for (const handler of this._handlers) { const result = await handler.handle({ ...record }); if (result === true) { break; } } } } exports.AsyncLogger = AsyncLogger;