feat: move project
This commit is contained in:
commit
4a940f28ba
97 changed files with 5047 additions and 0 deletions
53
utils/log.js
Normal file
53
utils/log.js
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
const A = {
|
||||
isLog: false,
|
||||
logList: [],
|
||||
}
|
||||
A.info = (msg) => {
|
||||
if (A.isLog) {
|
||||
return;
|
||||
}
|
||||
console.log('info', msg);
|
||||
A.logList.push({
|
||||
time: new Date(),
|
||||
msg: msg,
|
||||
type: 'info',
|
||||
});
|
||||
// console.log('logList', A.logList);
|
||||
}
|
||||
A.warn = (msg) => {
|
||||
if (A.isLog) {
|
||||
return;
|
||||
}
|
||||
console.log('warn', msg);
|
||||
A.logList.push({
|
||||
time: new Date(),
|
||||
msg: msg,
|
||||
type: 'warn',
|
||||
});
|
||||
}
|
||||
A.error = (msg) => {
|
||||
if (A.isLog) {
|
||||
return;
|
||||
}
|
||||
console.log('error', msg);
|
||||
A.logList.push({
|
||||
time: new Date(),
|
||||
msg: msg,
|
||||
type: 'error',
|
||||
});
|
||||
}
|
||||
A.getLogList = (type) => {
|
||||
if (type) {
|
||||
return A.logList.filter((o) => {
|
||||
return o.type == type;
|
||||
})
|
||||
}
|
||||
console.log('llllll', A.logList, type);
|
||||
return A.logList;
|
||||
}
|
||||
A.setIslog = (f) => {
|
||||
// console.log('setIslog', f);
|
||||
A.isLog = f;
|
||||
}
|
||||
|
||||
module.exports = A
|
||||
Loading…
Add table
Add a link
Reference in a new issue