markus / ConvertService / ServiceController / Markus.Service.Extensions / Helper / LogHelper.cs @ 5c387707
이력 | 보기 | 이력해설 | 다운로드 (626 Bytes)
1 |
using System; |
---|---|
2 |
using System.Collections.Generic; |
3 |
using System.Diagnostics; |
4 |
using System.Linq; |
5 |
using System.Text; |
6 |
using System.Threading.Tasks; |
7 |
|
8 |
namespace Markus.Service.Helper |
9 |
{ |
10 |
public static class LogHelper |
11 |
{ |
12 |
public static string GetStack() |
13 |
{ |
14 |
StackFrame stackFrame = new StackFrame(1, true); |
15 |
string fileName = stackFrame.GetFileName(); |
16 |
string methodName = stackFrame.GetMethod().ToString(); |
17 |
int lineNumber = stackFrame.GetFileLineNumber(); |
18 |
|
19 |
return $"{methodName} {System.IO.Path.GetFileName(fileName)} Line:{lineNumber}"; |
20 |
} |
21 |
} |
22 |
} |