begin reformat code structur
This commit is contained in:
1 parent
d0cb22b54e
commit
0495577b3c
18 files changed
+4071
-843
No files matched your search
@@ -0,0 +1,28 @@
|
||||
const winston = require("winston");
|
||||
const colors = require("colors");
|
||||
|
||||
class Logger {
|
||||
constructor(LoggingFile) {
|
||||
this.logger = winston.createLogger({
|
||||
transports: [new winston.transports.File({ filename: LoggingFile })],
|
||||
});
|
||||
}
|
||||
|
||||
log(Text) {
|
||||
let d = new Date();
|
||||
this.logger.log({
|
||||
level: "info",
|
||||
message:
|
||||
`${d.getHours()}:${
|
||||
d.getMinutes
|
||||
} - ${d.getDate()}:${d.getMonth()}:${d.getFullYear()} | Info: ` + Text,
|
||||
});
|
||||
console.log(
|
||||
colors.green(
|
||||
`${d.getDate()}:${d.getMonth()}:${d.getFullYear()} - ${d.getHours()}:${d.getMinutes()}`
|
||||
) + colors.yellow(" | Info: " + Text)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Logger;
|
||||
Reference in new issue
Block a user