| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
Tags
- Button
- E-P1
- Python
- pip
- CNN
- Numpy
- install
- 삼성소프트웨어멤버십
- ipad
- javascript
- Series
- GT-S80
- dataframe
- imread
- 알고리즘
- mean
- SciPy
- DFS
- GitHub
- index
- Splunk
- synology
- pycharm
- mariadb
- RNN
- Lotto
- SPL
- LSTM
- pandas
- 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