22 lines
624 B
C#
22 lines
624 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace APT.Infrastructure.Core
|
|
{
|
|
public static class LogHelper
|
|
{
|
|
/// /// 取得当前源码的哪一行 /// ///
|
|
|
|
public static int GetLineNum()
|
|
|
|
{ System.Diagnostics.StackTrace st = new System.Diagnostics.StackTrace(1, true); return st.GetFrame(0).GetFileLineNumber(); }
|
|
|
|
/// /// 取当前源码的源文件名 /// ///
|
|
|
|
public static string GetCurSourceFileName()
|
|
|
|
{ System.Diagnostics.StackTrace st = new System.Diagnostics.StackTrace(1, true); return st.GetFrame(0).GetFileName(); }
|
|
}
|
|
}
|