aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/root-helpers/logger.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-12-28 15:15:44 +0100
committerChocobozzz <me@florianbigard.com>2022-12-28 15:15:44 +0100
commitd522369bed42b0eb951fce403373602c4ec447da (patch)
treead65f546b654f6cd1e9c18e5ff063375ad232084 /client/src/root-helpers/logger.ts
parentded68a97600d70fb8bbadfbddac87eadb1233910 (diff)
downloadPeerTube-d522369bed42b0eb951fce403373602c4ec447da.tar.gz
PeerTube-d522369bed42b0eb951fce403373602c4ec447da.tar.zst
PeerTube-d522369bed42b0eb951fce403373602c4ec447da.zip
Prevent sending log error to server on 404
Diffstat (limited to 'client/src/root-helpers/logger.ts')
-rw-r--r--client/src/root-helpers/logger.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/client/src/root-helpers/logger.ts b/client/src/root-helpers/logger.ts
index d1fdf73aa..618be62cd 100644
--- a/client/src/root-helpers/logger.ts
+++ b/client/src/root-helpers/logger.ts
@@ -27,6 +27,10 @@ class Logger {
27 warn (message: LoggerMessage, meta?: LoggerMeta) { 27 warn (message: LoggerMessage, meta?: LoggerMeta) {
28 this.runHooks('warn', message, meta) 28 this.runHooks('warn', message, meta)
29 29
30 this.clientWarn(message, meta)
31 }
32
33 clientWarn (message: LoggerMessage, meta?: LoggerMeta) {
30 if (meta) console.warn(message, meta) 34 if (meta) console.warn(message, meta)
31 else console.warn(message) 35 else console.warn(message)
32 } 36 }
@@ -34,6 +38,10 @@ class Logger {
34 error (message: LoggerMessage, meta?: LoggerMeta) { 38 error (message: LoggerMessage, meta?: LoggerMeta) {
35 this.runHooks('error', message, meta) 39 this.runHooks('error', message, meta)
36 40
41 this.clientError(message, meta)
42 }
43
44 clientError (message: LoggerMessage, meta?: LoggerMeta) {
37 if (meta) console.error(message, meta) 45 if (meta) console.error(message, meta)
38 else console.error(message) 46 else console.error(message)
39 } 47 }