메뉴 건너뛰기

KIM0.COM

JAVA TIPS 로그

2017.02.06 16:33

Martin 조회 수:352

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 7563
12 java call stack 출력 샘플 (파일, 화면) Martin 2017.03.22 330
11 파일 쓰기 Martin 2017.03.22 350
» 로그 Martin 2017.02.06 352
9 이클립스 단축키 Martin 2016.11.24 867
8 jar 내보내기 및 실행 예제 Martin 2016.11.10 116
7 이클립스 설정 Martin 2016.11.02 351
6 이클립스 플러그인 설치 Martin 2016.10.26 378
5 Java MessageBox 출력 Martin 2016.10.24 245
4 java 및 이클립스 개발환경 구성 Martin 2016.10.19 231
3 접근 제어자 Martin 2016.10.15 60
2 매개 변수 Martin 2016.10.15 101
1 자바책 Martin 2016.10.14 2729