From b03c6fd3b0d33beee1dfaa8632db1724741ed383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Sun, 22 Aug 2021 20:47:40 +0300 Subject: [PATCH] Created logger function --- src/Client.ts | 3 ++- src/client/funcs/logger.js | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 src/client/funcs/logger.js diff --git a/src/Client.ts b/src/Client.ts index c5ea150..07894d4 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -5,7 +5,7 @@ import Datastore from "./client/datastore.js"; import { command, radio } from "./client/utils/typings.js"; import config from "./config.js"; import messages from "./client/messages.js"; -import path from "path" +import path from "path"; const GatewayIntents = new Discord.Intents(); GatewayIntents.add( @@ -32,6 +32,7 @@ class RadioClient extends Client { this.funcs.check = require("./client/funcs/check.js"); this.funcs.checkFetchStatus = require("./client/funcs/checkFetchStatus.js"); this.funcs.isDev = require("./client/funcs/isDev.js"); + this.funcs.logger = require("./client/funcs/logger.js"); this.funcs.msToTime = require("./client/funcs/msToTime.js"); this.funcs.statisticsUpdate = require("./client/funcs/statisticsUpdate.js"); diff --git a/src/client/funcs/logger.js b/src/client/funcs/logger.js new file mode 100644 index 0000000..ec961ef --- /dev/null +++ b/src/client/funcs/logger.js @@ -0,0 +1,4 @@ +module.exports = function (area, text){ + let date = new Date(); + console.log('[' + area + '](' + date.toISOString() + ') – ' + text); +} \ No newline at end of file