"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isTracingEnabled = isTracingEnabled;
exports.isTraceDebuggingEnabled = isTraceDebuggingEnabled;
exports.isTraceSendingEnabled = isTraceSendingEnabled;
exports.massageThrowable = massageThrowable;
const tslib_1 = require("tslib");
const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
function isTracingEnabled() {
    return isTraceDebuggingEnabled() || isTraceSendingEnabled();
}
function isTraceDebuggingEnabled() {
    return !!process.env.RENOVATE_TRACING_CONSOLE_EXPORTER;
}
function isTraceSendingEnabled() {
    return !!process.env.OTEL_EXPORTER_OTLP_ENDPOINT;
}
function massageThrowable(e) {
    if (is_1.default.nullOrUndefined(e)) {
        return undefined;
    }
    if (e instanceof Error) {
        return e.message;
    }
    return String(e);
}
//# sourceMappingURL=utils.js.map