메뉴 건너뛰기

KIM0.COM

JAVA TIPS 로그

2017.02.06 16:33

Martin 조회 수:882

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 8204
12 java call stack 출력 샘플 (파일, 화면) Martin 2017.03.22 992
11 파일 쓰기 Martin 2017.03.22 921
» 로그 Martin 2017.02.06 882
9 이클립스 단축키 Martin 2016.11.24 1461
8 jar 내보내기 및 실행 예제 Martin 2016.11.10 756
7 이클립스 설정 Martin 2016.11.02 995
6 이클립스 플러그인 설치 Martin 2016.10.26 992
5 Java MessageBox 출력 Martin 2016.10.24 780
4 java 및 이클립스 개발환경 구성 Martin 2016.10.19 841
3 접근 제어자 Martin 2016.10.15 634
2 매개 변수 Martin 2016.10.15 670
1 자바책 Martin 2016.10.14 3342