UNPKG

graphql-yoga

Version:
20 lines (19 loc) • 726 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createLoggerFromLogging = createLoggerFromLogging; const logger_1 = require("@graphql-hive/logger"); /** * Creates a {@link Logger} out of the `logging` option of the server. * * Kept in sync with Hive Gateway's `createLoggerFromLogging` so that both products * interpret the `logging` option in exactly the same way. */ function createLoggerFromLogging(logging) { if (logging == null || typeof logging === 'boolean') { return new logger_1.Logger({ level: logging === false ? false : 'info' }); } if (typeof logging === 'string') { return new logger_1.Logger({ level: logging }); } return logging; }