@bearz/exec
Version:
The exec module makes it easy to spawn child_processes across different runtimes and different operating systems.
29 lines (28 loc) • 629 B
JavaScript
/**
* The `logger` module provides a way to set a default logger function
* for logging command execution details.
*
* @module
*/
let logger = undefined;
/**
* Set the default logger function to write
* commands when they are invoked.
*
* @param defaultLogger The logger function to use.
* @example
* ```typescript
* import { setLogger } from "@bearz/exec/set-logger";
* setLogger(console.log);
* ```
*/
export function setLogger(defaultLogger) {
logger = defaultLogger;
}
/**
* Gets the default logger function.
* @returns The default logger function.
*/
export function getLogger() {
return logger;
}