Skip to content

Commit

Permalink
feat(logger): new method: program.getLogger()
Browse files Browse the repository at this point in the history
add program.getLogger() to get the logger instance

fixes #205
  • Loading branch information
mattallty committed Aug 28, 2023
1 parent ec64a84 commit a8b5fb6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/program/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { createConfigurator } from "../config"
import { fatalError, UnknownOrUnspecifiedCommandError } from "../error"
import { customizeHelp } from "../help"
import { CustomizedHelpOpts } from "../help/types"
import { logger, setLogger } from "../logger"
import { getLogger, logger, setLogger } from "../logger"
import {
addGlobalOption,
createOption,
Expand Down Expand Up @@ -308,6 +308,13 @@ export class Program extends EventEmitter {
return this
}

/**
* Get the configured logger instance
*/
getLogger(): Logger {
return getLogger()
}

/**
* Disable a global option. Will warn if the global option
* does not exist of has already been disabled.
Expand Down

0 comments on commit a8b5fb6

Please sign in to comment.