Beispiel #1
0
        private void Log(DiscordLogLevel level, string message, object data = null)
        {
            if (!IsLogging(level))
            {
                return;
            }

            string log = $"[Discord Extension] [{level.ToString()}]: {message}";

            switch (level)
            {
            case DiscordLogLevel.Debug:
            case DiscordLogLevel.Warning:
                Interface.Oxide.LogWarning(log);
                break;

            case DiscordLogLevel.Error:
                Interface.Oxide.LogError(log);
                break;

            case DiscordLogLevel.Exception:
                Interface.Oxide.LogException($"{log}\n{data}", (Exception)data);
                break;

            default:
                Interface.Oxide.LogInfo(log);
                break;
            }
        }
 private void UpdateLogLevel(DiscordLogLevel level)
 {
     Logger.UpdateLogLevel(level);
     Logger.Debug($"{nameof(BotClient)}.{nameof(UpdateLogLevel)} Updating log level from: {Settings.LogLevel.ToString()} to: {level.ToString()}");
     Settings.LogLevel = level;
 }