Exemplo n.º 1
0
 private void HandleException(string condition, string stackTrace, LogType type)
 {
     if (type == LogType.Exception)
     {
         JollyDebug.LogException("{0}: {1}\n{2}", type, condition, stackTrace);
     }
 }
Exemplo n.º 2
0
        public static void LogExceptionIf(string flagExpression, string message, params object[] args)
        {
            JollyDebug self = JollyDebug.Instance;

            if (self.EvaluateFlagExpression(flagExpression))
            {
                JollyDebug.LogException(message, args);
            }
        }
Exemplo n.º 3
0
        public static void Assert(bool expression, string message = "", params object[] args)
        {
            if (expression)
            {
                return;
            }
            string linewiseStackTrace = StackTraceUtility.ExtractStackTrace();
            string firstLine          = null;

            {
                string [] lines = linewiseStackTrace.Split(new char[] { '\n' });
                {
                    string [] skippedFirstLine = new string [lines.Length - 1];
                    System.Array.Copy(lines, 1, skippedFirstLine, 0, skippedFirstLine.Length);
                    lines = skippedFirstLine;
                }
                firstLine          = lines[0];
                linewiseStackTrace = string.Join("\n", lines);
            }
            message = string.Format(message, args);
            JollyDebug.LogException("ASSERTION FAILED in {0}\n{1}\n{2}", firstLine, message, linewiseStackTrace);
        }