일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
Tags
- install
- synology
- pandas
- 알고리즘
- Button
- pip
- imread
- ipad
- LSTM
- index
- pycharm
- Splunk
- SPL
- javascript
- DFS
- dataframe
- Python
- Numpy
- CNN
- E-P1
- RNN
- 삼성소프트웨어멤버십
- SciPy
- mariadb
- GT-S80
- Series
- mean
- Lotto
- GitHub
- keras
Archives
- Today
- Total
잠토의 잠망경
[CSharp] Debug & Trace 본문
Debug window 사용하기
output Windows에 Debugging용 Text를 남길수 있다.
public void ShowDebug()
{
Debug.WriteLine(".....debug...start....");
Debug.Indet(); // 들여쓰기 시작
Debug.WriteLine(".....debug.......");
Debug.WriteLine(".....debug......."); Debug.Unindet(); // 들여쓰기 종료
Debug.WriteLine(".....debug...end....");
}
Debug Window + File output
Debug를 사용하면 기본 output에 나오기때문에 system.console.out을 추가로 할 필요는 없다.
public void ShowDebug()
{
TextWriterTraceListener tr1 = new TextWriterTraceListener(System.Console.out);//없어도 잘됨
TextWriterTraceListener tr2 = new
TextWriterTraceListener(System.IO.File.CreateText("output.txt")); // File 생성
Debug.WriteLine(".....debug...start....");
Debug.Indet(); // 들여쓰기 시작
Debug.WriteLine(".....debug.......");
Debug.WriteLine(".....debug......."); Debug.Unindet(); // 들여쓰기 종료
Debug.WriteLine(".....debug...end....");
Debug.Flush(); // Flush 함수
}
Release Mode의 경우
Debug.XXX는 무시된다.
Realease Mode Setting
Debug.WriteLine(".....debug...start....");
Debug.Indet(); // 들여쓰기 시작
Debug.WriteLine(".....debug.......");
Debug.WriteLine(".....debug......."); Debug.Unindet(); // 들여쓰기 종료
Debug.WriteLine(".....debug...end....");
Debug.Flush(); // Flush 함수
Trace.WriteLine("....Trace....");// 이것만 출력됨
Comments