java/sql-dk/src/main/java/info/globalcode/sql/dk/logging/LoggerProducer.java
author František Kučera <franta-hg@frantovo.cz>
Mon, 04 Mar 2019 20:15:24 +0100
branchv_0
changeset 238 4a1864c3e867
parent 223 java/sql-dk/src/info/globalcode/sql/dk/logging/LoggerProducer.java@195d969a1fb1
child 250 aae5009bd0af
permissions -rw-r--r--
mavenized: sql-dk
franta-hg@223
     1
/**
franta-hg@223
     2
 * SQL-DK
franta-hg@223
     3
 * Copyright © 2015 František Kučera (frantovo.cz)
franta-hg@223
     4
 *
franta-hg@223
     5
 * This program is free software: you can redistribute it and/or modify
franta-hg@223
     6
 * it under the terms of the GNU General Public License as published by
franta-hg@223
     7
 * the Free Software Foundation, either version 3 of the License, or
franta-hg@223
     8
 * (at your option) any later version.
franta-hg@223
     9
 *
franta-hg@223
    10
 * This program is distributed in the hope that it will be useful,
franta-hg@223
    11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
franta-hg@223
    12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
franta-hg@223
    13
 * GNU General Public License for more details.
franta-hg@223
    14
 *
franta-hg@223
    15
 * You should have received a copy of the GNU General Public License
franta-hg@223
    16
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
franta-hg@223
    17
 */
franta-hg@223
    18
package info.globalcode.sql.dk.logging;
franta-hg@223
    19
franta-hg@223
    20
import java.util.logging.Logger;
franta-hg@223
    21
franta-hg@223
    22
/**
franta-hg@223
    23
 *
franta-hg@223
    24
 * @author Ing. František Kučera (frantovo.cz)
franta-hg@223
    25
 */
franta-hg@223
    26
public class LoggerProducer {
franta-hg@223
    27
franta-hg@223
    28
	/**
franta-hg@223
    29
	 * @return created logger for the caller class
franta-hg@223
    30
	 */
franta-hg@223
    31
	public static Logger getLogger() {
franta-hg@223
    32
		String className = Thread.currentThread().getStackTrace()[2].getClassName();
franta-hg@223
    33
		return Logger.getLogger(className);
franta-hg@223
    34
	}
franta-hg@223
    35
franta-hg@223
    36
}