Exemple #1
0
        public void Log(CallerInfo info, LogLevel level, string message, params object[] args)
        {
            if (!isEnabled) return;

            StringBuilder builder = new StringBuilder();

            builder.Append(DateTime.Now.ToString("MM/dd")).Append(" - ").Append(info.FileName).Append(":").Append(info.FunctionName);
            builder.Append("(line ").Append(info.LineNumber).Append(") - ").AppendLine(string.Format(message, args));
            try
            {

                if (level == LogLevel.Error)
                {
                    Tracker myTracker = EasyTracker.GetTracker();
                    myTracker.SendException(builder.ToString(), false);
                }
                else if (level == LogLevel.Info)
                {
                    Tracker myTracker = EasyTracker.GetTracker();
                    myTracker.SendEvent("MatoInfoEvent", message, builder.ToString(), 0);
                }
                else if (level == LogLevel.Nav)
                {
                    Tracker myTracker = EasyTracker.GetTracker();
                    myTracker.SendView(message);
                }
            }
            catch (Exception exx)
            {
            }

            //var async = ThreadPool.RunAsync(new WorkItemHandler((IAsyncAction) =>
            //{
            //    WriteLog(builder.ToString());
            //}));
        }
Exemple #2
0
        public void Log(CallerInfo info, LogLevel level, string message, params object[] args)
        {
            if (!isEnabled) return;

            StringBuilder builder = new StringBuilder();

            builder.Append(DateTime.Now.ToString("MM/dd/yy hh:mm:ss.fff")).Append(" - ").Append(info.FileName).Append(":").Append(info.FunctionName);
            builder.Append("(line ").Append(info.LineNumber).Append(") - ").AppendLine(string.Format(message, args));

            var async = ThreadPool.RunAsync(new WorkItemHandler((IAsyncAction) =>
            {
                WriteLog(builder.ToString());   
            }));
        }
Exemple #3
0
 public static void Alert(CallerInfo callerInfo, string message, params Object[] args)
 {
     Assert(callerInfo, false, string.Format(message, args));
 }
Exemple #4
0
 public static bool Assert(CallerInfo callerInfo, bool assertion)
 {
     return(Assert(callerInfo, assertion, "Assertion Failed"));
 }
Exemple #5
0
 public static void Alert(CallerInfo callerInfo, string message)
 {
     Assert(callerInfo, false, message);
 }