Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change: log message #2427

Merged
merged 1 commit into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Component/commandManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ export class CommandManager extends LogEmitter<{}> {

private constructor(){
super("CommandsManager");
this.logger.info("Initializing");
this.logger.trace("Initializing");

this._commands = (require("../Commands/_index") as typeof import("../Commands/_index")).default.filter(n => !n.disabled);

this.initializeMap({ reportDupes: getConfig().debug });
this.initializeSubcommandNames();

this.logger.info("Initialized");
this.logger.trace("Initialized");
}

private initializeMap({ reportDupes }: { reportDupes: boolean }){
Expand Down
4 changes: 2 additions & 2 deletions src/Component/telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class Telemetry extends LogEmitter<Record<never, never>> {

this.logger.info("Discord-SimpleMusicBot now collects completely anonymous telemetry data about usage.");
this.logger.info("This is completely optional and you can opt-out it.");
this.logger.info("See https://sr.usamyon.moe/dsmb-telemetry for more info.");
this.logger.info("See https://sr.usamyon.moe/dsmb-telemetry for details.");

this.bot.once("ready", this.onReady.bind(this));
}
Expand Down Expand Up @@ -100,7 +100,7 @@ export class Telemetry extends LogEmitter<Record<never, never>> {
.digest()
.toString("hex");

this.logger.debug(`Telemetry hash is "${hash}"`);
this.logger.debug(`(SECRET) Telemetry hash is "${hash}"`);

return hash;
}
Expand Down
2 changes: 1 addition & 1 deletion src/events/ready.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export async function onReady(this: MusicBot){

this["_mentionText"] = `<@${client.user.id}>`;

this.logger.info("Starting environment checking and preparation now");
this.logger.info("Starting environment checking and preparation.");

// Set activity as booting
if(!this.maintenance){
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ const logger = log4js.getLogger("Entry");
const config = getConfig();

logger.info("Discord-SimpleMusicBot by mtripg6666tdr");
logger.info("This application was originally built by mtripg6666tdr and is licensed under GPLv3 or later.");
logger.info("This application was originally written by mtripg6666tdr and is licensed under GPLv3 or later.");
logger.info("There is no warranty for the work, both of the original and its forks.");
logger.info("However if you found any bugs in the original please feel free to report them by creating an issue on GitHub.");
logger.info("However if you find a bug in the original application, please feel free to report it by creating an issue on GitHub.");
logger.info("Thank you for using Discord-SimpleMusicBot!");
logger.info(`Node.js v${process.versions.node}`);

Expand Down
7 changes: 6 additions & 1 deletion src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,15 @@ const memoryAppender = {
const logContent = `${level}:[${
tokens.category(logEvent)
}] ${logEvent.data.map(data => typeof data === "string" ? data : stringifyObject(data))}`;
memoryStore.push(logContent);

if(!logContent.includes("(SECRET)")){
memoryStore.push(logContent);
}

if(memoryStore.length > MEMORYSTORE_MAXSIZE){
memoryStore.shift();
}

if(process.env.CONSOLE_ENABLE){
console[level === "F" || level === "E" ? "error" : level === "W" ? "warn" : "log"](logContent);
}
Expand Down