Пример #1
0
 /// <summary>
 /// Sends the value provided by the provided delegate, only if Debug is enabled.
 /// </summary>
 /// <typeparam name="T">The type of object we are logging about.</typeparam>
 /// <param name="logger">The logger to use.</param>
 /// <param name="function">The function to evaluate if Debug logging is enabled.</param>
 public static void Info <T>(this IFullLogger logger, Func <string> function)
 {
     if (logger.IsInfoEnabled)
     {
         logger.Info <T>(function.Invoke());
     }
 }
Пример #2
0
 /// <summary>
 /// Sends the value provided by the provided delegate, only if Info is enabled.
 /// </summary>
 /// <param name="logger">The logger to use.</param>
 /// <param name="function">The function to evaluate if Info logging is enabled.</param>
 /// <param name="exception">A exception to log about.</param>
 public static void InfoException(this IFullLogger logger, Func <string> function, Exception exception)
 {
     if (logger.IsInfoEnabled)
     {
         logger.Info(function.Invoke(), exception);
     }
 }
Пример #3
0
        /// <summary>
        /// Sends the value provided by the provided delegate, only if Debug is enabled.
        /// </summary>
        /// <param name="logger">The logger to use.</param>
        /// <param name="function">The function to evaluate if Debug logging is enabled.</param>
        public static void Info(this IFullLogger logger, Func <string> function)
        {
            if (logger is null)
            {
                throw new ArgumentNullException(nameof(logger));
            }

            if (function is null)
            {
                throw new ArgumentNullException(nameof(function));
            }

            if (logger.IsInfoEnabled)
            {
                logger.Info(function.Invoke());
            }
        }
Пример #4
0
        internal void ProcessChatCommand(object sender, CommandEventArgs e)
        {
            Window1.< > c__DisplayClass16_0 CS$ < > 8__locals1 = new Window1.< > c__DisplayClass16_0();
            CS$ < > 8__locals1.e           = e;
            CS$ < > 8__locals1.< > 4__this = this;
            IFullLogger      @default = LogHost.Default;
            string           str      = "[ProcessChatCommand] New command: ";
            CommandEventArgs e2       = CS$ < > 8__locals1.e;

            @default.Info(str + ((e2 != null) ? e2.ToString() : null));
            CS$ < > 8__locals1.mem = ((sender is FFXIVMemory) ? (sender as FFXIVMemory) : Program.mem);
            if (CS$ < > 8__locals1.mem == null)
            {
                return;
            }
            if (CS$ < > 8__locals1.e.Command == Command.Hunt && this.hunts != null)
            {
                Window1.< > c__DisplayClass16_1 CS$ < > 8__locals2 = new Window1.< > c__DisplayClass16_1();
                CS$ < > 8__locals2.CS$ < > 8__locals1 = CS$ < > 8__locals1;
                Tuple <ushort, ushort, float, float> hi;
                if (GameResources.TryGetDailyHuntInfo(CS$ < > 8__locals2.CS$ < > 8__locals1.e.Parameter, out hi))
                {
                    CS$ < > 8__locals2.CS$ < > 8__locals1.mem.WriteChatMessage(ChatMessage.MakePosChatMessage(string.Format(CultureInfo.CurrentCulture, FFXIV_GameSense.Properties.Resources.LKICanBeFoundAt, GameResources.GetEnemyName((uint)hi.Item1, true)), hi.Item2, hi.Item3, hi.Item4, "", 0));
                    return;
                }
                if (FFXIVHunts.Worlds.First <KeyValuePair <ushort, World> >().Value.Hunts.Exists((Hunt x) => x.Name.Equals(CS$ < > 8__locals2.CS$ < > 8__locals1.e.Parameter, StringComparison.OrdinalIgnoreCase)))
                {
                    this.hunts.QueryHunt(FFXIVHunts.Worlds.First <KeyValuePair <ushort, World> >().Value.Hunts.First((Hunt x) => x.Name.Equals(CS$ < > 8__locals2.CS$ < > 8__locals1.e.Parameter, StringComparison.OrdinalIgnoreCase)).Id);
                    return;
                }
                ushort bnpcid;
                if (GameResources.GetEnemyId(CS$ < > 8__locals2.CS$ < > 8__locals1.e.Parameter, out bnpcid))
                {
                    this.hunts.RandomPositionForBNpc(bnpcid);
                    return;
                }
                CS$ < > 8__locals2.fid = GameResources.GetFateId(CS$ < > 8__locals2.CS$ < > 8__locals1.e.Parameter, true);
                if (CS$ < > 8__locals2.fid > 0)
                {
                    this.hunts.LastKnownInfoForFATE(CS$ < > 8__locals2.fid);
                    if (Settings.Default.TrackFATEAfterQuery)
                    {
                        this.vm.FATEEntries.SingleOrDefault((FATEListViewItem x) => x.ID == CS$ < > 8__locals2.fid).Announce = true;
                        return;
                    }
                }
Пример #5
0
        public static void LogForType(this IFullLogger logger, NotificationType notificationType, string message)
        {
            switch (notificationType)
            {
            case NotificationType.Info:
                logger.Info(message);
                break;

            case NotificationType.Warning:
                logger.Warn(message);
                break;

            case NotificationType.Error:
                logger.Error(message);
                break;
            }
        }