-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
// Default configuration file name | ||
export const FILE_NAME = 'kpo.scripts'; | ||
// Default logging level | ||
export const DEFAULT_LOG_LEVEL = 'info'; | ||
// Default stdio for spawned commands | ||
export const DEFAULT_STDIO = 'inherit'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export default function main(): void {} | ||
export * from './types'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { LogLevelDesc } from 'loglevel'; | ||
|
||
export type TLogger = LogLevelDesc; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import loglevel from 'loglevel'; | ||
import { DEFAULT_LOG_LEVEL } from '~/constants'; | ||
import { TLogger } from '~/types'; | ||
|
||
const logger = loglevel.getLogger('_kpo_logger_'); | ||
logger.setDefaultLevel(DEFAULT_LOG_LEVEL); | ||
|
||
export default logger; | ||
export function setLevel(level: TLogger): void { | ||
logger.setLevel(level); | ||
} |