LogError() public static méthode

public static LogError ( Exception ex ) : void
ex System.Exception
Résultat void
Exemple #1
0
        public void StartQuest(string questName)
        {
            var quest = Quests.FirstOrDefault(q => q.Name == questName);

            if (quest != null)
            {
                quest.Start(false);
            }
            else
            {
                RPGLog.LogError("Failed to start quest. Quest not found: " + questName);
            }
        }
Exemple #2
0
        private void OnTick(object sender, EventArgs e)
        {
            //var s = new Stopwatch();
            //s.Start();

            if (CannotUpdate())
            {
                return;
            }
            try
            {
                if (_emptyUpdate)
                {
                    _emptyUpdate = false;
                    return;
                }

                if (_firstUpdate)
                {
                    Start();
                    _firstUpdate = false;
                }

                Update();
            }
            catch (Exception ex)
            {
                if (!(ex is ThreadAbortException))
                {
                    RPGLog.LogError(ex.GetType() + ": " + ex.Message + "\n" + ex.StackTrace);
                    RPGLog.Log("Terminated script: " + GetType());
                    _running = false;
                }
            }

            //if (s.ElapsedMilliseconds > 0)
            //    RPGLog.Log(GetType() + " took " + s.ElapsedMilliseconds + " to tick.");
        }