Skip to content

Commit d165eff

Browse files
committed
feat(@142vip/utils): 新增VipConsole日志工具
1 parent f60de1a commit d165eff

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

packages/utils/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export * from './constants'
22
export * from './http'
3+
export * from './pkgs/console'
34
export * from './core'

packages/utils/src/pkgs/console.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
function trace(message?: any, ...optionalParams: any[]): void {
2+
console.trace(message, optionalParams)
3+
}
4+
5+
function info(message?: any, ...optionalParams: any[]): void {
6+
console.info(message, optionalParams)
7+
}
8+
function log(message?: any, ...optionalParams: any[]): void {
9+
console.log(message, optionalParams)
10+
}
11+
12+
function warn(message?: any, ...optionalParams: any[]): void {
13+
console.warn(message, optionalParams)
14+
}
15+
16+
function error(message?: any, ...optionalParams: any[]): void {
17+
console.error(message, optionalParams)
18+
}
19+
20+
/**
21+
* 日志
22+
*/
23+
export const VipConsole = {
24+
log,
25+
info,
26+
warn,
27+
trace,
28+
error,
29+
}

0 commit comments

Comments
 (0)