ArchiSteamFarm.ArchiLogger.LogGenericWarning C# (CSharp) Метод

LogGenericWarning() приватный Метод

private LogGenericWarning ( string message, [ previousMethodName = null ) : void
message string
previousMethodName [
Результат void
        internal void LogGenericWarning(string message, [CallerMemberName] string previousMethodName = null)
        {
            if (string.IsNullOrEmpty(message)) {
                LogNullError(nameof(message));
                return;
            }

            Logger.Warn($"{previousMethodName}() {message}");
        }

Usage Example

Пример #1
0
        internal static async Task InitBots()
        {
            if (Bot.Bots.Count != 0)
            {
                return;
            }

            // Before attempting to connect, initialize our configuration
            await Bot.InitializeSteamConfiguration(Program.GlobalConfig.SteamProtocols, Program.GlobalDatabase.CellID, Program.GlobalDatabase.ServerListProvider).ConfigureAwait(false);

            HashSet <string> botNames;

            try {
                botNames = Directory.EnumerateFiles(SharedInfo.ConfigDirectory, "*" + SharedInfo.ConfigExtension).Select(Path.GetFileNameWithoutExtension).Where(botName => !string.IsNullOrEmpty(botName) && IsValidBotName(botName)).ToHashSet();
            } catch (Exception e) {
                ArchiLogger.LogGenericException(e);

                return;
            }

            if (botNames.Count == 0)
            {
                ArchiLogger.LogGenericWarning(Strings.ErrorNoBotsDefined);

                return;
            }

            if (botNames.Count > MaximumRecommendedBotsCount)
            {
                ArchiLogger.LogGenericWarning(string.Format(Strings.WarningExcessiveBotsCount, MaximumRecommendedBotsCount));
                await Task.Delay(10000).ConfigureAwait(false);
            }

            await Utilities.InParallel(botNames.OrderBy(botName => botName).Select(Bot.RegisterBot)).ConfigureAwait(false);
        }
All Usage Examples Of ArchiSteamFarm.ArchiLogger::LogGenericWarning