메뉴 건너뛰기

KIM0.COM

JAVA TIPS 로그

2017.02.06 16:33

Martin 조회 수:353

System.out.printf("pgl [%s.%s()Ln%:d-%s]\n",
new Throwable().getStackTrace()[0].getClassName(),
new Throwable().getStackTrace()[0].getMethodName(),
new Throwable().getStackTrace()[0].getLineNumber(),
new java.text.SimpleDateFormat("yyyyMMdd HH:mm:ss").format(new java.util.Date())); // peegol

--- 또는 ---

System.out.println(new java.text.SimpleDateFormat("yyyyMMdd HH:mm:ss").format(new java.util.Date()) + " ["
+ new Throwable().getStackTrace()[0].getClassName() + "." + new Throwable().getStackTrace()[0].getMethodName()
+ "()Ln:" + new Throwable().getStackTrace()[0].getLineNumber() + "] pgl "); // peegol
System.out.println("pgl #> ");
번호 제목 글쓴이 날짜 조회 수
13 Maven 관련 에러 Martin 2017.08.31 7564
12 자바책 Martin 2016.10.14 2730
11 이클립스 단축키 Martin 2016.11.24 868
10 이클립스 플러그인 설치 Martin 2016.10.26 379
» 로그 Martin 2017.02.06 353
8 이클립스 설정 Martin 2016.11.02 352
7 파일 쓰기 Martin 2017.03.22 351
6 java call stack 출력 샘플 (파일, 화면) Martin 2017.03.22 331
5 Java MessageBox 출력 Martin 2016.10.24 246
4 java 및 이클립스 개발환경 구성 Martin 2016.10.19 232
3 jar 내보내기 및 실행 예제 Martin 2016.11.10 117
2 매개 변수 Martin 2016.10.15 102
1 접근 제어자 Martin 2016.10.15 61