Skip to content
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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ planned for 2026-01-01
### Updated

- [core] Update dependencies (#3909, #3916, #3921, #3925)
- [logger] Add prefixes to most Log messages (#3923)

## [2.33.0] - 2025-10-01

Expand Down Expand Up @@ -358,7 +359,7 @@ For more info, please read the following post: [A New Chapter for MagicMirror: T
### Fixed

- [weather] Correct apiBase of weathergov weatherProvider to match documentation (#2926)
- Worked around several issues in the RRULE library that were causing deleted calender events to still show, some
- Worked around several issues in the RRULE library that were causing deleted calendar events to still show, some
initial and recurring events to not show, and some event times to be off an hour. (#3291)
- Skip changelog requirement when running tests for dependency updates (#3320)
- Display precipitation probability when it is 0% instead of blank/empty (#3345)
Expand Down
4 changes: 2 additions & 2 deletions js/animateCSS.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function addAnimateCSS (element, animation, animationTime) {
const node = document.getElementById(element);
if (!node) {
// don't execute animate: we don't find div
Log.warn("addAnimateCSS: node not found for", element);
Log.warn("[animateCSS] node not found for adding", element);
return;
}
node.style.setProperty("--animate-duration", `${animationTime}s`);
Expand All @@ -149,7 +149,7 @@ function removeAnimateCSS (element, animation) {
const node = document.getElementById(element);
if (!node) {
// don't execute animate: we don't find div
Log.warn("removeAnimateCSS: node not found for", element);
Log.warn("[animateCSS] node not found for removing", element);
return;
}
node.classList.remove("animate__animated", animationName);
Expand Down
12 changes: 6 additions & 6 deletions js/check_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function checkConfigFile () {
}

// Validate syntax of the configuration file.
Log.info(`Checking config file ${configFileName} ...`);
Log.info(`[checkconfig] Checking config file ${configFileName} ...`);

// I'm not sure if all ever is utf-8
const configFile = fs.readFileSync(configFileName, "utf-8");
Expand All @@ -67,7 +67,7 @@ function checkConfigFile () {
);

if (errors.length === 0) {
Log.info(styleText("green", "Your configuration file doesn't contain syntax errors :)"));
Log.info(styleText("green", "[checkconfig] Your configuration file doesn't contain syntax errors :)"));
validateModulePositions(configFileName);
} else {
let errorMessage = "Your configuration file contains syntax errors :(";
Expand All @@ -84,7 +84,7 @@ function checkConfigFile () {
* @param {string} configFileName - The path and filename of the configuration file to validate.
*/
function validateModulePositions (configFileName) {
Log.info("Checking modules structure configuration ...");
Log.info("[checkconfig] Checking modules structure configuration ...");

const positionList = Utils.getModulePositions();

Expand Down Expand Up @@ -118,7 +118,7 @@ function validateModulePositions (configFileName) {

const valid = validate(data);
if (valid) {
Log.info(styleText("green", "Your modules structure configuration doesn't contain errors :)"));
Log.info(styleText("green", "[checkconfig] Your modules structure configuration doesn't contain errors :)"));
} else {
const module = validate.errors[0].instancePath.split("/")[2];
const position = validate.errors[0].instancePath.split("/")[3];
Expand All @@ -130,13 +130,13 @@ function validateModulePositions (configFileName) {
} else {
errorMessage += validate.errors[0].message;
}
Log.error(errorMessage);
Log.error("[checkconfig]", errorMessage);
}
}

try {
checkConfigFile();
} catch (error) {
Log.error(error.message);
Log.error("[checkconfig]", error);
process.exit(1);
}
8 changes: 4 additions & 4 deletions js/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function createWindow () {
try {
electronSize = electron.screen.getPrimaryDisplay().workAreaSize;
} catch {
Log.warn("Could not get display size, using defaults ...");
Log.warn("[electron] Could not get display size, using defaults ...");
}

let electronSwitchesDefaults = ["autoplay-policy", "no-user-gesture-required"];
Expand Down Expand Up @@ -196,7 +196,7 @@ app.on("activate", function () {
* core.stop() is called by process.on("SIGINT"... in `app.js`
*/
app.on("before-quit", async (event) => {
Log.log("Shutting down server...");
Log.log("[electron] Shutting down server...");
event.preventDefault();
setTimeout(() => {
process.exit(0);
Expand All @@ -215,7 +215,7 @@ app.on("certificate-error", (event, webContents, url, error, certificate, callba

if (process.env.clientonly) {
app.whenReady().then(() => {
Log.log("Launching client viewer application.");
Log.log("[electron] Launching client viewer application.");
createWindow();
});
}
Expand All @@ -228,7 +228,7 @@ if (["localhost", "127.0.0.1", "::1", "::ffff:127.0.0.1", undefined].includes(co
core.start().then((c) => {
config = c;
app.whenReady().then(() => {
Log.log("Launching application.");
Log.log("[electron] Launching application.");
createWindow();
});
});
Expand Down
1 change: 0 additions & 1 deletion js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ const MM = (function () {
const hideModule = function (module, speed, callback, options = {}) {
// set lockString if set in options.
if (options.lockString) {
// Log.log("Has lockstring: " + options.lockString);
if (module.lockStrings.indexOf(options.lockString) === -1) {
module.lockStrings.push(options.lockString);
}
Expand Down
5 changes: 2 additions & 3 deletions js/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ const Module = Class.extend({
* Called when the module is instantiated.
*/
init () {
//Log.log(this.defaults);
},

/**
Expand Down Expand Up @@ -145,9 +144,9 @@ const Module = Class.extend({
*/
notificationReceived (notification, payload, sender) {
if (sender) {
// Log.log(this.name + " received a module notification: " + notification + " from sender: " + sender.name);
Log.debug(`${this.name} received a module notification: ${notification} from sender: ${sender.name}`);
} else {
// Log.log(this.name + " received a system notification: " + notification);
Log.debug(`${this.name} received a system notification: ${notification}`);
}
},

Expand Down
12 changes: 6 additions & 6 deletions js/node_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ const Class = require("./class");

const NodeHelper = Class.extend({
init () {
Log.log("Initializing new module helper ...");
Log.log("[nodehelper] Initializing new module helper ...");
},

loaded () {
Log.log(`Module helper loaded: ${this.name}`);
Log.log(`[nodehelper] Module helper loaded: ${this.name}`);
},

start () {
Log.log(`Starting module helper: ${this.name}`);
Log.log(`[nodehelper] Starting module helper: ${this.name}`);
},

/**
Expand All @@ -21,7 +21,7 @@ const NodeHelper = Class.extend({
* gracefully exit the module.
*/
stop () {
Log.log(`Stopping module helper: ${this.name}`);
Log.log(`[nodehelper] Stopping module helper: ${this.name}`);
},

/**
Expand All @@ -30,7 +30,7 @@ const NodeHelper = Class.extend({
* @param {object} payload The payload of the notification.
*/
socketNotificationReceived (notification, payload) {
Log.log(`${this.name} received a socket notification: ${notification} - Payload: ${payload}`);
Log.log(`[nodehelper] ${this.name} received a socket notification: ${notification} - Payload: ${payload}`);
},

/**
Expand Down Expand Up @@ -83,7 +83,7 @@ const NodeHelper = Class.extend({
setSocketIO (io) {
this.io = io;

Log.log(`Connecting socket for: ${this.name}`);
Log.log(`[nodehelper] Connecting socket for: ${this.name}`);

io.of(this.name).on("connection", (socket) => {
// register catch all.
Expand Down
14 changes: 5 additions & 9 deletions js/translator.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const Translator = (function () {
fileInfo = JSON.parse(xhr.responseText);
} catch (exception) {
// nothing here, but don't die
Log.error(` loading json file =${file} failed`);
Log.error(`[translator] loading json file =${file} failed`);
}
resolve(fileInfo);
}
Expand Down Expand Up @@ -67,22 +67,18 @@ const Translator = (function () {
}

if (this.translations[module.name] && key in this.translations[module.name]) {
// Log.log("Got translation for " + key + " from module translation: ");
return createStringFromTemplate(this.translations[module.name][key], variables);
}

if (key in this.coreTranslations) {
// Log.log("Got translation for " + key + " from core translation.");
return createStringFromTemplate(this.coreTranslations[key], variables);
}

if (this.translationsFallback[module.name] && key in this.translationsFallback[module.name]) {
// Log.log("Got translation for " + key + " from module translation fallback.");
return createStringFromTemplate(this.translationsFallback[module.name][key], variables);
}

if (key in this.coreTranslationsFallback) {
// Log.log("Got translation for " + key + " from core translation fallback.");
return createStringFromTemplate(this.coreTranslationsFallback[key], variables);
}

Expand All @@ -96,7 +92,7 @@ const Translator = (function () {
* @param {boolean} isFallback Flag to indicate fallback translations.
*/
async load (module, file, isFallback) {
Log.log(`${module.name} - Load translation${isFallback ? " fallback" : ""}: ${file}`);
Log.log(`[translator] ${module.name} - Load translation${isFallback ? " fallback" : ""}: ${file}`);

if (this.translationsFallback[module.name]) {
return;
Expand All @@ -113,10 +109,10 @@ const Translator = (function () {
*/
async loadCoreTranslations (lang) {
if (lang in translations) {
Log.log(`Loading core translation file: ${translations[lang]}`);
Log.log(`[translator] Loading core translation file: ${translations[lang]}`);
this.coreTranslations = await loadJSON(translations[lang]);
} else {
Log.log("Configured language not found in core translations.");
Log.log("[translator] Configured language not found in core translations.");
}

await this.loadCoreTranslationsFallback();
Expand All @@ -129,7 +125,7 @@ const Translator = (function () {
async loadCoreTranslationsFallback () {
let first = Object.keys(translations)[0];
if (first) {
Log.log(`Loading core translation fallback file: ${translations[first]}`);
Log.log(`[translator] Loading core translation fallback file: ${translations[first]}`);
this.coreTranslationsFallback = await loadJSON(translations[first]);
}
}
Expand Down
2 changes: 1 addition & 1 deletion modules/default/alert/alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Module.register("alert", {
return new Promise((resolve) => {
this.nunjucksEnvironment().render(this.getTemplate(type), data, function (err, res) {
if (err) {
Log.error("Failed to render alert", err);
Log.error("[alert] Failed to render alert", err);
}

resolve(res);
Expand Down
28 changes: 14 additions & 14 deletions modules/default/calendar/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ Module.register("calendar", {
Log.info(`Starting module: ${this.name}`);

if (this.config.colored) {
Log.warn("Your are using the deprecated config values 'colored'. Please switch to 'coloredSymbol' & 'coloredText'!");
Log.warn("[calendar] Your are using the deprecated config values 'colored'. Please switch to 'coloredSymbol' & 'coloredText'!");
this.config.coloredText = true;
this.config.coloredSymbol = true;
}
if (this.config.coloredSymbolOnly) {
Log.warn("Your are using the deprecated config values 'coloredSymbolOnly'. Please switch to 'coloredSymbol' & 'coloredText'!");
Log.warn("[calendar] Your are using the deprecated config values 'coloredSymbolOnly'. Please switch to 'coloredSymbol' & 'coloredText'!");
this.config.coloredText = false;
this.config.coloredSymbol = true;
}
Expand Down Expand Up @@ -143,7 +143,7 @@ Module.register("calendar", {

// we check user and password here for backwards compatibility with old configs
if (calendar.user && calendar.pass) {
Log.warn("Deprecation warning: Please update your calendar authentication configuration.");
Log.warn("[calendar] Deprecation warning: Please update your calendar authentication configuration.");
Log.warn("https://docs.magicmirror.builders/modules/calendar.html#configuration-options");
calendar.auth = {
user: calendar.user,
Expand All @@ -160,7 +160,7 @@ Module.register("calendar", {

// for backward compatibility titleReplace
if (typeof this.config.titleReplace !== "undefined") {
Log.warn("Deprecation warning: Please consider upgrading your calendar titleReplace configuration to customEvents.");
Log.warn("[calendar] Deprecation warning: Please consider upgrading your calendar titleReplace configuration to customEvents.");
for (const [titlesearchstr, titlereplacestr] of Object.entries(this.config.titleReplace)) {
this.config.customEvents.push({ keyword: ".*", transform: { search: titlesearchstr, replace: titlereplacestr } });
}
Expand Down Expand Up @@ -201,7 +201,7 @@ Module.register("calendar", {
// set this calendar as displayed
this.calendarDisplayer[payload.url] = true;
} else {
Log.debug("[Calendar] DOM not updated waiting self update()");
Log.debug("[calendar] DOM not updated waiting self update()");
}
return;
}
Expand Down Expand Up @@ -461,10 +461,10 @@ Module.register("calendar", {
if (eventStartDateMoment.isSameOrAfter(now) || (event.fullDayEvent && eventEndDateMoment.diff(now, "days") === 0)) {
// Use relative time
if (!this.config.hideTime && !event.fullDayEvent) {
Log.debug("event not hidden and not fullday");
Log.debug("[calendar] event not hidden and not fullday");
timeWrapper.innerHTML = `${CalendarUtils.capFirst(eventStartDateMoment.calendar(null, { sameElse: this.config.dateFormat }))}`;
} else {
Log.debug("event full day or hidden");
Log.debug("[calendar] event full day or hidden");
timeWrapper.innerHTML = `${CalendarUtils.capFirst(
eventStartDateMoment.calendar(null, {
sameDay: this.config.showTimeToday ? "LT" : `[${this.translate("TODAY")}]`,
Expand All @@ -491,9 +491,9 @@ Module.register("calendar", {
timeWrapper.innerHTML = CalendarUtils.capFirst(this.translate("DAYAFTERTOMORROW"));
}
}
Log.info("event fullday");
Log.info("[calendar] event fullday");
} else if (eventStartDateMoment.diff(now, "h") < this.config.getRelative) {
Log.info("not full day but within getrelative size");
Log.info("[calendar] not full day but within getrelative size");
// If event is within getRelative hours, display 'in xxx' time format or moment.fromNow()
timeWrapper.innerHTML = `${CalendarUtils.capFirst(eventStartDateMoment.fromNow())}`;
}
Expand Down Expand Up @@ -680,14 +680,14 @@ Module.register("calendar", {
by_url_calevents.sort(function (a, b) {
return a.startDate - b.startDate;
});
Log.debug(`pushing ${by_url_calevents.length} events to total with room for ${remainingEntries}`);
Log.debug(`[calendar] pushing ${by_url_calevents.length} events to total with room for ${remainingEntries}`);
events = events.concat(by_url_calevents.slice(0, remainingEntries));
Log.debug(`events for calendar=${events.length}`);
Log.debug(`[calendar] events for calendar=${events.length}`);
} else {
events = events.concat(by_url_calevents);
}
}
Log.info(`sorting events count=${events.length}`);
Log.info(`[calendar] sorting events count=${events.length}`);
events.sort(function (a, b) {
return a.startDate - b.startDate;
});
Expand Down Expand Up @@ -721,7 +721,7 @@ Module.register("calendar", {
}
events = newEvents;
}
Log.info(`slicing events total maxcount=${this.config.maximumEntries}`);
Log.info(`[calendar] slicing events total maxcount=${this.config.maximumEntries}`);
return events.slice(0, this.config.maximumEntries);
},

Expand Down Expand Up @@ -936,7 +936,7 @@ Module.register("calendar", {
setTimeout(
() => {
setInterval(() => {
Log.debug("[Calendar] self update");
Log.debug("[calendar] self update");
if (this.config.updateOnFetch) {
this.updateDom(1);
} else {
Expand Down
4 changes: 2 additions & 2 deletions modules/default/calendar/calendarfetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const CalendarFetcher = function (url, reloadInterval, excludedEvents, maximumEn

try {
data = ical.parseICS(responseData);
Log.debug(`parsed data=${JSON.stringify(data, null, 2)}`);
Log.debug(`[calendar] parsed data=${JSON.stringify(data, null, 2)}`);
events = CalendarFetcherUtils.filterEvents(data, {
excludedEvents,
includePastEvents,
Expand Down Expand Up @@ -91,7 +91,7 @@ const CalendarFetcher = function (url, reloadInterval, excludedEvents, maximumEn
* Broadcast the existing events.
*/
this.broadcastEvents = function () {
Log.info(`Calendar-Fetcher: Broadcasting ${events.length} events from ${url}.`);
Log.info(`[calendar] Fetcher: Broadcasting ${events.length} events from ${url}.`);
eventsReceivedCallback(this);
};

Expand Down
Loading