mirror of
https://github.com/tvytlx/ai-agent-deep-dive.git
synced 2026-04-03 07:34:50 +08:00
30 lines
677 B
JavaScript
30 lines
677 B
JavaScript
export function getLogger({ silent = false } = {}) {
|
|
return {
|
|
log: (...args) => {
|
|
if (!silent) {
|
|
console.log(...args);
|
|
}
|
|
},
|
|
error: (...args) => {
|
|
if (!silent) {
|
|
console.error(...args);
|
|
}
|
|
},
|
|
warn: (...args) => {
|
|
if (!silent) {
|
|
console.warn(...args);
|
|
}
|
|
},
|
|
info: (...args) => {
|
|
if (!silent) {
|
|
console.info(...args);
|
|
}
|
|
},
|
|
debug: (...args) => {
|
|
if (!silent) {
|
|
console.debug(...args);
|
|
}
|
|
},
|
|
};
|
|
}
|