mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-21 02:59:39 +08:00
separate log functions
This commit is contained in:
18
src/util.ts
18
src/util.ts
@@ -49,8 +49,7 @@ export function ucfirst(str: string) {
|
||||
return firstLetter.toUpperCase() + str.substr(1);
|
||||
}
|
||||
|
||||
// log levels = info / warn / error / debug
|
||||
export function log(module: string, msg: any, level:string = "info") {
|
||||
function log(module: string, msg: any, level:string) {
|
||||
module = module.toUpperCase();
|
||||
level = level.toUpperCase();
|
||||
|
||||
@@ -72,6 +71,21 @@ export function log(module: string, msg: any, level:string = "info") {
|
||||
}
|
||||
}
|
||||
|
||||
export function log_info(module: string, msg: any) {
|
||||
log(module, msg, "info");
|
||||
}
|
||||
|
||||
export function log_warn(module: string, msg: any) {
|
||||
log(module, msg, "warn");
|
||||
}
|
||||
|
||||
export function log_error(module: string, msg: any) {
|
||||
log(module, msg, "error");
|
||||
}
|
||||
|
||||
export function log_debug(module: string, msg: any) {
|
||||
log(module, msg, "debug");
|
||||
}
|
||||
|
||||
declare global { interface String { replaceAll(str: string, newStr: string): string; } }
|
||||
|
||||
|
Reference in New Issue
Block a user