protected void log(string msg, Level level) { #if DEBUG StackTrace st = new StackTrace(); StackFrame callerFrame = st.GetFrame(2); string callerInfo = callerFrame.GetMethod().DeclaringType.Name + "." + callerFrame.GetMethod().Name + "()"; LogCallback callback = new LogCallback(logCallback); callback.BeginInvoke(msg, level, DateTime.Now, callerInfo, Thread.CurrentThread.ManagedThreadId, null, null); #endif }