This commit is contained in:
16
app/ayanova/src/utils/logit.js
Normal file
16
app/ayanova/src/utils/logit.js
Normal file
@@ -0,0 +1,16 @@
|
||||
/* eslint-disable */
|
||||
import cbuffer from "./cbuffer";
|
||||
|
||||
const buffer = new cbuffer(10);
|
||||
export default {
|
||||
log(msg, obj) {
|
||||
if (obj) {
|
||||
msg = msg + "|[" + JSON.stringify(obj) + "]";
|
||||
}
|
||||
msg = Date.now() + "|" + msg;
|
||||
buffer.push(msg);
|
||||
},
|
||||
getLog() {
|
||||
return buffer.toArray();
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user