"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.PinoLogger = void 0;
const pino_1 = __importDefault(require("pino"));
const env_1 = require("../../main/config/env");
const createPinoInstance = () => {
    const isProduction = env_1.env.NODE_ENV === 'production';
    return (0, pino_1.default)({
        level: env_1.env.LOG_LEVEL,
        base: {
            service: 'trust-wallet-server',
            env: env_1.env.NODE_ENV,
        },
        ...(isProduction
            ? {}
            : {
                transport: {
                    target: 'pino-pretty',
                    options: {
                        colorize: true,
                        translateTime: 'SYS:standard',
                        ignore: 'pid,hostname',
                    },
                },
            }),
    });
};
const rootLogger = createPinoInstance();
class PinoLogger {
    logger;
    constructor(logger) {
        this.logger = logger ?? rootLogger;
    }
    debug(message, context) {
        this.logger.debug(context ?? {}, message);
    }
    info(message, context) {
        this.logger.info(context ?? {}, message);
    }
    warn(message, context) {
        this.logger.warn(context ?? {}, message);
    }
    error(message, context) {
        this.logger.error(context ?? {}, message);
    }
    child(bindings) {
        return new PinoLogger(this.logger.child(bindings));
    }
}
exports.PinoLogger = PinoLogger;
//# sourceMappingURL=pino-logger.js.map