Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Log errors/warnings to the console always

Manav Rathi1b3e11f713f7
diff --git a/desktop/src/main/log.ts b/desktop/src/main/log.ts
index cf1404a90a..e39d2be9c5 100644
--- a/desktop/src/main/log.ts
+++ b/desktop/src/main/log.ts
@@ -62,7 +62,7 @@ const logError = (message: string, e?: unknown) => {
const logError_ = (message: string) => {
log.error(`[main] [error] ${message}`);
- if (isDev) console.error(`[error] ${message}`);
+ console.error(`[error] ${message}`);
};
const logInfo = (...params: unknown[]) => {
@@ -96,8 +96,8 @@ export default {
* any arbitrary object that we obtain, say, when in a try-catch handler (in
* JavaScript any arbitrary value can be thrown).
*
- * The log is written to disk. In development builds, the log is also
- * printed to the main (Node.js) process console.
+ * The log is written to disk and printed to the main (Node.js) process's
+ * console.
*/
error: logError,
/**
@@ -120,7 +120,7 @@ export default {
* The function can return an arbitrary value which is serialized before
* being logged.
*
- * This log is NOT written to disk. And it is printed to the main (Node.js)
+ * This log is NOT written to disk. It is printed to the main (Node.js)
* process console, but only on development builds.
*/
debug: logDebug,
diff --git a/web/packages/next/log.ts b/web/packages/next/log.ts
index f9ef7e5493..0129a93a16 100644
--- a/web/packages/next/log.ts
+++ b/web/packages/next/log.ts
@@ -45,13 +45,13 @@ const messageWithError = (message: string, e?: unknown) => {
const logError = (message: string, e?: unknown) => {
const m = `[error] ${messageWithError(message, e)}`;
- if (isDevBuild) console.error(m);
+ console.error(m);
logToDisk(m);
};
const logWarn = (message: string, e?: unknown) => {
const m = `[warn] ${messageWithError(message, e)}`;
- if (isDevBuild) console.error(m);
+ console.error(m);
logToDisk(m);
};
@@ -89,8 +89,7 @@ export default {
* any arbitrary object that we obtain, say, when in a try-catch handler (in
* JavaScript any arbitrary value can be thrown).
*
- * The log is written to disk. In development builds, the log is also
- * printed to the browser console.
+ * The log is written to disk and printed to the browser console.
*/
error: logError,
/**
@@ -118,8 +117,8 @@ export default {
* The function can return an arbitrary value which is serialized before
* being logged.
*
- * This log is NOT written to disk. And it is printed to the browser
- * console, but only in development builds.
+ * This log is NOT written to disk. It is printed to the browser console,
+ * but only in development builds.
*/
debug: logDebug,
};