Beispiel #1
0
 public void Disconnect(System.Delegate func)
 {
     try
     {
         System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate <System.Delegate>(func);
         {
             Interop.ActorSignal.Disconnect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
             if (NDalicPINVOKE.SWIGPendingException.Pending)
             {
                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             }
         }
     }
     catch (global::System.Exception ex)
     {
         Tizen.Log.Fatal("NUI", $"[ERROR] excpetion! {ex}: {ex.Message}");
         Tizen.Log.Fatal("NUI", $"[ERROR] current threadID : {Thread.CurrentThread.ManagedThreadId}");
         Tizen.Log.Fatal("NUI", $"[ERROR] back trace!");
         global::System.Diagnostics.StackTrace st = new global::System.Diagnostics.StackTrace(true);
         for (int i = 0; i < st.FrameCount; i++)
         {
             global::System.Diagnostics.StackFrame sf = st.GetFrame(i);
             Tizen.Log.Fatal("NUI", " Method " + sf.GetMethod());
         }
     }
 }
Beispiel #2
0
        public static global::Array <object> makeStack(global::System.Diagnostics.StackTrace s)
        {
            global::Array <object> stack = new global::Array <object>(new object[] {});

            {
                int _g1 = 0;
                int _g  = s.FrameCount;
                while ((_g1 < _g))
                {
                    int i = _g1++;
                    global::System.Diagnostics.StackFrame frame = s.GetFrame(((int)(i)));
                    global::System.Reflection.MethodBase  m     = frame.GetMethod();
                    if ((m == null))
                    {
                        continue;
                    }

                    global::haxe.StackItem method = global::haxe.StackItem.Method(((m as global::System.Reflection.MemberInfo).ReflectedType as global::System.Reflection.MemberInfo).ToString(), (m as global::System.Reflection.MemberInfo).Name);
                    string fileName   = frame.GetFileName();
                    int    lineNumber = frame.GetFileLineNumber();
                    if ((!(string.Equals(fileName, null)) || (lineNumber >= 0)))
                    {
                        stack.push(global::haxe.StackItem.FilePos(method, fileName, lineNumber));
                    }
                    else
                    {
                        stack.push(method);
                    }
                }
            }

            return(stack);
        }
 public static uint GetMethodIndex(this SDStackFrame frame)
 {
     if (getMethodIndex == null)
     {
         return(0xffffff);
     }
     return((uint)getMethodIndex.Invoke(frame, null));
 }
 public static long GetMethodAddress(this SDStackFrame frame)
 {
     if (getMethodAddress == null)
     {
         return(0);
     }
     return((long)getMethodAddress.Invoke(frame, null));
 }
Beispiel #5
0
 // Token: 0x06000310 RID: 784 RVA: 0x000113E8 File Offset: 0x0000F5E8
 private static string Format(string text, global::VRGIN.Core.VRLog.LogMode mode)
 {
     global::System.Diagnostics.StackTrace stackTrace = new global::System.Diagnostics.StackTrace(3);
     global::System.Diagnostics.StackFrame frame      = stackTrace.GetFrame(0);
     return(string.Format("[{0}][{1}][{3}#{4}] {2}", new object[]
     {
         global::System.DateTime.Now.ToString("HH':'mm':'ss"),
         mode.ToString().ToUpper(),
         text,
         frame.GetMethod().DeclaringType.Name,
         frame.GetMethod().Name,
         frame.GetFileLineNumber()
     }));
 }
Beispiel #6
0
        public void CheckError()
        {
            GLError err = this._gl.GetError();

            if (err != GLError.NoError)
            {
                global::Uno.Diagnostics.Debug.Log(("GL error (" + (object)err) + ")", global::Uno.Diagnostics.DebugMessageType.Error);
                global::System.Diagnostics.StackFrame[] frames = new global::System.Diagnostics.StackTrace().GetFrames();

                for (int i = 3; i < frames.Length; i++)
                {
                    global::System.Diagnostics.StackFrame f = frames[i];

                    if (f.GetMethod().Name == "Main")
                    {
                        break;
                    }

                    global::Uno.Diagnostics.Debug.Log(((("in " + f.GetMethod().DeclaringType) + ".") + f.GetMethod().Name) + "()", global::Uno.Diagnostics.DebugMessageType.Debug);
                }
            }
        }
Beispiel #7
0
        public static global::Array <object> toHaxe(global::System.Diagnostics.StackTrace native, global::haxe.lang.Null <int> skip)
        {
                        #line 31 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx"
            int skip1 = ((!(skip.hasValue)) ? (0) : ((skip).@value));
            global::Array <object> stack = new global::Array <object>(new object[] {});
                        #line 33 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx"
            if ((native == null))
            {
                                #line 34 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx"
                return(stack);
            }

                        #line 36 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx"
            int cnt = 0;
            {
                                #line 37 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx"
                int _g = 0;
                                #line 37 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx"
                int _g1 = native.FrameCount;
                                #line 37 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx"
                while ((_g < _g1))
                {
                                        #line 37 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx"
                    int i = _g++;
                    global::System.Diagnostics.StackFrame frame = native.GetFrame(((int)(i)));
                                        #line 39 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx"
                    global::System.Reflection.MethodBase m = frame.GetMethod();
                                        #line 41 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx"
                    if ((m == null))
                    {
                                                #line 42 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx"
                        continue;
                    }

                                        #line 44 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx"
                    if ((skip1 > cnt++))
                    {
                                                #line 45 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx"
                        continue;
                    }

                                        #line 48 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx"
                    global::haxe.StackItem method = global::haxe.StackItem.Method(((m as global::System.Reflection.MemberInfo).ReflectedType as global::System.Reflection.MemberInfo).ToString(), (m as global::System.Reflection.MemberInfo).Name);
                                        #line 50 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx"
                    string fileName   = frame.GetFileName();
                    int    lineNumber = frame.GetFileLineNumber();
                                        #line 53 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx"
                    if (((fileName != null) || (lineNumber >= 0)))
                    {
                                                #line 54 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx"
                        stack.push(global::haxe.StackItem.FilePos(method, fileName, lineNumber, default(global::haxe.lang.Null <int>)));
                    }
                    else
                    {
                                                #line 56 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx"
                        stack.push(method);
                    }
                }
            }

                        #line 58 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx"
            return(stack);
        }
 public static string GetInternalMethodName(this SDStackFrame frame)
 {
     return(getInternalMethodName?.Invoke(frame, null) as string);
 }
Beispiel #9
0
        // Private Methods (2) 

        private bool LogInner(DateTimeOffset time,
                              Assembly asm,
                              LoggerFacadeCategories?categories,
                              string tag,
                              object msg)
        {
            try
            {
                if (DBNull.Value.Equals(msg))
                {
                    msg = null;
                }

                if (msg is IEnumerable <char> )
                {
                    msg = StringHelper.AsString((IEnumerable <char>)msg);
                }

                Thread thread = Thread.CurrentThread;

                MemberInfo member = null;
#if !(MONO2 || MONO20 || MONO4 || MONO40)
                try
                {
#pragma warning disable 618
                    global::System.Diagnostics.StackTrace st = new global::System.Diagnostics.StackTrace(thread, false);
#pragma warning restore 618
                    global::System.Diagnostics.StackFrame sf = st.GetFrame(2);

                    member = sf.GetMethod();
                }
                catch
                {
                    // ignore errors here
                }
#endif
                // collect categories
                List <LoggerFacadeCategories> listOfCategories = new List <LoggerFacadeCategories>();

                string strCategories = categories.ToString();
                if (StringHelper.IsNullOrWhiteSpace(strCategories) == false)
                {
                    CollectionHelper.ForEach(strCategories.Split(','),
                                             delegate(IForEachItemExecutionContext <string, List <LoggerFacadeCategories> > ctx)
                    {
                        List <LoggerFacadeCategories> loc = ctx.State;

                        LoggerFacadeCategories loggerCat = (LoggerFacadeCategories)Enum.Parse(typeof(global::MarcelJoachimKloubert.CLRToolbox.Diagnostics.LoggerFacadeCategories),
                                                                                              ctx.Item,                             // enum value name
                                                                                              false);

                        if (loc.Contains(loggerCat) == false)
                        {
                            loc.Add(loggerCat);
                        }
                    }, listOfCategories);
                }

                listOfCategories.Sort();

                LogMessage orgMsg = new LogMessage();
                orgMsg.Assembly   = asm;
                orgMsg.Categories = listOfCategories.ToArray();
                orgMsg.Id         = Guid.NewGuid();
                orgMsg.LogTag     = StringHelper.AsString(tag);
                orgMsg.Member     = member;
                orgMsg.Message    = msg;
                orgMsg.Thread     = thread;
                orgMsg.Time       = time;

#if !WINDOWS_PHONE
                try
                {
                    orgMsg.Context = global::System.Threading.Thread.CurrentContext;
                }
                catch
                {
                    // ignore errors here
                }

                try
                {
                    orgMsg.Principal = global::System.Threading.Thread.CurrentPrincipal;
                }
                catch
                {
                    // ignore errors here
                }
#endif

                ILogMessage messageToLog = orgMsg;

                bool checkAgain;
                do
                {
                    checkAgain = false;

                    if (messageToLog == null)
                    {
                        break;
                    }

                    ILogCommand logCmd = messageToLog.Message as ILogCommand;
                    if (logCmd != null)
                    {
                        // logic to execute

                        messageToLog = null;
                        if (logCmd.CanExecute(orgMsg))
                        {
                            ILogCommandExecutionResult result = logCmd.Execute(orgMsg);
                            if (result != null)
                            {
                                if (result.HasFailed)
                                {
                                    throw new AggregateException(result.Errors);
                                }

                                if (result.DoLogMessage)
                                {
                                    // send 'result.MessageValueToLog'
                                    // to "real" logger logic

                                    messageToLog = CreateCopyOfLogMessage(orgMsg,
                                                                          result.MessageValueToLog);
                                }
                            }
                        }

                        // maybe 'messageToLog' can be a log command again
                        checkAgain = true;
                    }
                    else
                    {
                        ICommand <ILogMessage> cmd = messageToLog.Message as ICommand <ILogMessage>;
                        if (cmd != null)
                        {
                            // general command

                            messageToLog = null;
                            if (cmd.CanExecute(orgMsg))
                            {
                                cmd.Execute(orgMsg);
                            }
                        }
                    }
                }while (checkAgain);

                this._ON_LOG_ACTION(messageToLog);
                return(true);
            }
            catch
            {
                // ignore errors
                return(false);
            }
        }