Skip to content

Commit

Permalink
Fix stdout pollution with newlines
Browse files Browse the repository at this point in the history
  • Loading branch information
3urobeat committed May 6, 2023
1 parent afa4b8a commit be80698
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/controller/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Created Date: 09.07.2021 16:26:00
* Author: 3urobeat
*
* Last Modified: 06.05.2023 11:17:05
* Last Modified: 06.05.2023 13:14:29
* Modified By: 3urobeat
*
* Copyright (c) 2021 3urobeat <https://github.com/HerrEurobeat>
Expand Down Expand Up @@ -104,7 +104,8 @@ Controller.prototype._start = async function() {


/* ------------ Mark new execution in output: ------------ */
logger("", "\n\nBootup sequence started...", true, true);
logger("", "", true, true); // Log one newline separated so it only shows up in output.txt
logger("", "\nBootup sequence started...", true, true); // ...add the second newline here so it also shows up in stdout. The message itself gets cleared because remove is true.
logger("", "---------------------------------------------------------", true, true);


Expand Down
4 changes: 2 additions & 2 deletions src/controller/events/ready.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Created Date: 29.03.2023 12:23:29
* Author: 3urobeat
*
* Last Modified: 06.05.2023 11:39:51
* Last Modified: 06.05.2023 12:52:16
* Modified By: 3urobeat
*
* Copyright (c) 2023 3urobeat <https://github.com/HerrEurobeat>
Expand Down Expand Up @@ -114,7 +114,7 @@ Controller.prototype._readyEvent = function() {


// Log amount of warnings displayed by dataCheck and remind the user to take a look
if (this.info.dataCheckWarnings > 0) logger("warn", `The bot started with ${this.info.dataCheckWarnings} warning(s)! Please scroll up and read the warnings displayed during startup!`, true);
if (this.info.dataCheckWarnings > 0) logger("warn", `The bot started with ${this.info.dataCheckWarnings} warning(s)! Please scroll up and read the warnings displayed during startup!\n`, true);


// Please star my repo :)
Expand Down
5 changes: 3 additions & 2 deletions src/starter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Created Date: 10.07.2021 10:26:00
* Author: 3urobeat
*
* Last Modified: 05.05.2023 16:44:52
* Last Modified: 06.05.2023 13:10:54
* Modified By: 3urobeat
*
* Copyright (c) 2021 3urobeat <https://github.com/HerrEurobeat>
Expand Down Expand Up @@ -315,7 +315,8 @@ module.exports.checkAndGetFile = (file, logger, norequire, force) => {
} else {

try {
if (!file.includes("logger.js")) logger("debug", `checkAndGetFile(): file ${file} exists, force and norequire are false. Testing integrity by requiring...`); // Ignore message for logger.js as it won't use the real logger yet
// Don't log debug msg for logger & handleErrors as they get loaded before the actual logger is loaded. This looks bad in the terminal, is kinda irrelevant and is logged even when logDebug is off
if (!file.includes("logger.js") && !file.includes("handleErrors.js")) logger("debug", `checkAndGetFile(): file ${file} exists, force and norequire are false. Testing integrity by requiring...`); // Ignore message for logger.js as it won't use the real logger yet

let fileToLoad = require("." + file);

Expand Down

0 comments on commit be80698

Please sign in to comment.