@vuu-ui/vuu-codemirror 0.7.0-debug → 0.7.1-debug

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cjs/index.js CHANGED
@@ -14927,10 +14927,21 @@ var metadataKeys = {
14927
14927
  // ../vuu-utils/src/DataWindow.ts
14928
14928
  var { KEY } = metadataKeys;
14929
14929
 
14930
+ // ../vuu-utils/src/cookie-utils.ts
14931
+ var getCookieValue = (name) => {
14932
+ var _a2, _b;
14933
+ if (((_a2 = globalThis.document) == null ? void 0 : _a2.cookie) !== void 0) {
14934
+ return (_b = globalThis.document.cookie.split("; ").find((row) => row.startsWith(`${name}=`))) == null ? void 0 : _b.split("=")[1];
14935
+ }
14936
+ };
14937
+
14930
14938
  // ../vuu-utils/src/logging-utils.ts
14939
+ var logLevels = ["error", "warn", "info", "debug"];
14940
+ var isValidLogLevel = (value) => typeof value === "string" && logLevels.includes(value);
14941
+ var DEFAULT_LOG_LEVEL = "error";
14931
14942
  var NO_OP = () => void 0;
14932
14943
  var DEFAULT_DEBUG_LEVEL = false ? "error" : "info";
14933
- var { loggingLevel = DEFAULT_DEBUG_LEVEL } = typeof loggingSettings !== "undefined" ? loggingSettings : {};
14944
+ var { loggingLevel = DEFAULT_DEBUG_LEVEL } = getLoggingSettings();
14934
14945
  var logger = (category) => {
14935
14946
  const debugEnabled2 = loggingLevel === "debug";
14936
14947
  const infoEnabled = debugEnabled2 || loggingLevel === "info";
@@ -14958,6 +14969,23 @@ var logger = (category) => {
14958
14969
  };
14959
14970
  }
14960
14971
  };
14972
+ function getLoggingSettings() {
14973
+ if (typeof loggingSettings !== "undefined") {
14974
+ return loggingSettings;
14975
+ } else {
14976
+ return {
14977
+ loggingLevel: getLoggingLevelFromCookie()
14978
+ };
14979
+ }
14980
+ }
14981
+ function getLoggingLevelFromCookie() {
14982
+ const value = getCookieValue("vuu-logging-level");
14983
+ if (isValidLogLevel(value)) {
14984
+ return value;
14985
+ } else {
14986
+ return DEFAULT_LOG_LEVEL;
14987
+ }
14988
+ }
14961
14989
 
14962
14990
  // ../vuu-utils/src/debug-utils.ts
14963
14991
  var { debug, debugEnabled } = logger("range-monitor");