"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var LogLevel_exports = {};
__export(LogLevel_exports, {
  LogLevel: () => LogLevel,
  logLevelFromString: () => logLevelFromString
});
module.exports = __toCommonJS(LogLevel_exports);
var import_MatterError = require("#MatterError.js");
/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
function LogLevel(level) {
  if (typeof level === "string" && level.match(/^\d+$/)) {
    level = Number.parseInt(level);
  }
  if (typeof level === "string") {
    switch (level.toLowerCase()) {
      case "debug":
        return LogLevel.DEBUG;
      case "info":
        return LogLevel.INFO;
      case "notice":
        return LogLevel.NOTICE;
      case "warn":
        return LogLevel.WARN;
      case "error":
        return LogLevel.ERROR;
      case "fatal":
        return LogLevel.FATAL;
      default:
    }
  } else if (level >= 0 && level <= 5) {
    return level;
  }
  throw new import_MatterError.ImplementationError(`Unsupported log level "${level}"`);
}
((LogLevel2) => {
  LogLevel2.DEBUG = 0;
  LogLevel2.INFO = 1;
  LogLevel2.NOTICE = 2;
  LogLevel2.WARN = 3;
  LogLevel2.ERROR = 4;
  LogLevel2.FATAL = 5;
  LogLevel2.names = ["debug", "info", "notice", "warn", "error", "fatal"];
})(LogLevel || (LogLevel = {}));
LogLevel[0] = "debug";
LogLevel[1] = "info";
LogLevel[2] = "notice";
LogLevel[3] = "warn";
LogLevel[4] = "error";
LogLevel[5] = "fatal";
const logLevelFromString = LogLevel;
//# sourceMappingURL=LogLevel.js.map
