Skip to content

Commit

Permalink
error logs
Browse files Browse the repository at this point in the history
  • Loading branch information
c121914yu committed Aug 31, 2023
1 parent 2121afb commit 166553a
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions frontend/packages/client-sdk/src/utils/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,7 @@ export function infoLog(msg: string, obj: Record<string, any> = {}) {
}

export function errLog(msg: string, error: any) {
console.log(`[ERROR] ${formatTime(new Date())}`);
console.log({
message: msg,
stack: error?.stack,
...(error?.config && {
config: {
headers: error.config.headers,
url: error.config.url,
data: error.config.data
}
}),
...(error?.body && {
body: error?.body
}),
...(error?.response && {
response: {
status: error.response.status,
statusText: error.response.statusText
}
})
});
console.log(`[ERROR] ${formatTime(new Date())} ${msg}`, error);
}

export function warnLog(msg: string, obj: Record<string, any> = {}) {
Expand Down

0 comments on commit 166553a

Please sign in to comment.