Skip to content

Commit

Permalink
fix: set default log level correctly to "info"
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Nov 20, 2020
1 parent 7abbef7 commit 49153b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/helpers/get-log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { getTransformStream, Options, LogLevel } from "@probot/pino";

type GetLogOptions = { level?: LogLevel } & Options;

export function getLog(options: GetLogOptions = { level: "info" }) {
export function getLog(options: GetLogOptions = {}) {
const deprecated = [];
if (process.env.LOG_FORMAT && !options.logFormat) {
deprecated.push('"LOG_FORMAT"');
Expand All @@ -35,7 +35,7 @@ export function getLog(options: GetLogOptions = { level: "info" }) {
}
const { level, ...getTransformStreamOptions } = options;

const pinoOptions: LoggerOptions = { level, name: "probot" };
const pinoOptions: LoggerOptions = { level: level || "info", name: "probot" };
const transform = getTransformStream(getTransformStreamOptions);
transform.pipe(pino.destination(1));
const log = pino(pinoOptions, transform);
Expand Down

0 comments on commit 49153b8

Please sign in to comment.