Skip to content
Snippets Groups Projects
Commit ebe3225e authored by syuilo's avatar syuilo
Browse files

Add overload

parent d511e112
No related branches found
No related tags found
No related merge requests found
......@@ -10,9 +10,12 @@ function toLevelColor(level: LogLevel): chalk.ChalkStyle {
}
}
export function log(message: string): void;
export function log(level: LogLevel, message: string): void;
export function log(level: LogLevel, message: string, domain: string): void;
export function log(level: LogLevel, message: string, domain?: string): void {
export function log(x: string | LogLevel, message?: string, domain?: string): void {
const level = typeof message == 'undefined' ? 'Info' : x as LogLevel;
message = typeof message == 'undefined' ? x : message;
if (typeof domain == 'string') {
log(level, `[${domain}] ${message}`);
} else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment