From def79f104999710953124c77241c95a7726791f0 Mon Sep 17 00:00:00 2001
From: Kristóf Marussy <kristof@marussy.com>
Date: Sat, 30 Oct 2021 14:36:39 +0200
Subject: chore(web): move logger to utils/

---
 language-web/src/main/js/logging.tsx | 49 ------------------------------------
 1 file changed, 49 deletions(-)
 delete mode 100644 language-web/src/main/js/logging.tsx

(limited to 'language-web/src/main/js/logging.tsx')

diff --git a/language-web/src/main/js/logging.tsx b/language-web/src/main/js/logging.tsx
deleted file mode 100644
index 306d122c..00000000
--- a/language-web/src/main/js/logging.tsx
+++ /dev/null
@@ -1,49 +0,0 @@
-import styles, { CSPair } from 'ansi-styles';
-import log from 'loglevel';
-import * as prefix from 'loglevel-plugin-prefix';
-
-const colors: Partial<Record<string, CSPair>> = {
-  TRACE: styles.magenta,
-  DEBUG: styles.cyan,
-  INFO: styles.blue,
-  WARN: styles.yellow,
-  ERROR: styles.red,
-};
-
-prefix.reg(log);
-
-if (DEBUG) {
-  log.setLevel(log.levels.DEBUG);
-} else {
-  log.setLevel(log.levels.WARN);
-}
-
-if ('chrome' in window) {
-  // Only Chromium supports console ANSI escape sequences.
-  prefix.apply(log, {
-    format(level, name, timestamp) {
-      const formattedTimestamp = `${styles.gray.open}[${timestamp.toString()}]${styles.gray.close}`;
-      const levelColor = colors[level.toUpperCase()] || styles.red;
-      const formattedLevel = `${levelColor.open}${level}${levelColor.close}`;
-      const formattedName = `${styles.green.open}(${name || 'root'})${styles.green.close}`;
-      return `${formattedTimestamp} ${formattedLevel} ${formattedName}`;
-    },
-  });
-} else {
-  prefix.apply(log, {
-    template: '[%t] %l (%n)',
-  });
-}
-
-const appLogger = log.getLogger(PACKAGE_NAME);
-
-appLogger.info('Version:', PACKAGE_NAME, PACKAGE_VERSION);
-appLogger.info('Debug mode:', DEBUG);
-
-export function getLoggerFromRoot(name: string | symbol): log.Logger {
-  return log.getLogger(name);
-}
-
-export function getLogger(name: string | symbol): log.Logger {
-  return getLoggerFromRoot(`${PACKAGE_NAME}.${name.toString()}`);
-}
-- 
cgit v1.2.3-70-g09d2

