<!DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<style>BODY{font:10pt Tahoma, Verdana, sans-serif;}</style>
</head>
<body>
<DIV>Good Afternoon<BR><BR>I have created a wrapper layer for SLF4J (Listed below). However the line number are incorrect, it is using the line numbers in the wrapper class not the class that I called the wrapper from. What is the correct way to fix this?<BR><BR>package com.test.commons.logging;<BR><BR>import com.test.commons.logging.LoggerFactory.LEVEL;<BR><BR>public class Logger {<BR><BR> private LEVEL infoLevel = LEVEL.FINE;<BR> private LEVEL debugLevel = LEVEL.FINE;<BR> <BR> private org.slf4j.Logger logger = null;<BR><BR> public Logger(Class clazz, LEVEL infoLevel, LEVEL debugLevel) {<BR> this.infoLevel = infoLevel;<BR> this.debugLevel = debugLevel;<BR> logger = org.slf4j.LoggerFactory.getLogger(clazz);<BR> <BR> }<BR> <BR> public Logger(String name, LEVEL infoLevel, LEVEL debugLevel) {<BR> this.infoLevel = infoLevel;<BR> this.debugLevel = debugLevel;<BR> logger = org.slf4j.LoggerFactory.getLogger(name);<BR> }<BR> <BR> public void info(String message) {<BR> logger.info(message);<BR> }<BR> <BR> public void info(String message, Throwable throwable) {<BR> logger.info(message, throwable);<BR> }<BR> <BR> public void info(String message, Object[] objects) {<BR> if(logger.isInfoEnabled()) {<BR> logger.info(message, objects);<BR> }<BR> }<BR> <BR> public void info(LEVEL level, String message) {<BR> if((logger.isInfoEnabled()) && (level.ordinal() <= infoLevel.ordinal())) {<BR> logger.info(message);<BR> }<BR> }<BR> <BR> public void info(LEVEL level, String message, Throwable throwable) {<BR> if((logger.isInfoEnabled()) && (level.ordinal() <= infoLevel.ordinal())) {<BR> logger.info(message, throwable);<BR> }<BR> }<BR> <BR> public void info(LEVEL level, String message, Object[] objects) {<BR> if((logger.isInfoEnabled()) && (level.ordinal() <= infoLevel.ordinal())) {<BR> logger.info(message, objects);<BR> }<BR> }<BR> <BR> // Debug messages.<BR> public void debug(String message) {<BR> if(logger.isDebugEnabled()) {<BR> logger.debug(message);<BR> }<BR> <BR> }<BR> public void debug(String message, Throwable throwable) {<BR> if(logger.isDebugEnabled()) {<BR> logger.debug(message, throwable);<BR> }<BR> }<BR> <BR> public void debug(String message, Object[] objects) {<BR> if(logger.isDebugEnabled()) {<BR> logger.debug(message, objects);<BR> }<BR> }<BR> <BR> public void debug(LEVEL level, String message) {<BR> if((logger.isDebugEnabled()) && (level.ordinal() <= debugLevel.ordinal())) {<BR> logger.debug(message);<BR> }<BR> }<BR> <BR> public void debug(LEVEL level, String message, Throwable throwable) {<BR> if((logger.isDebugEnabled()) && (level.ordinal() <= debugLevel.ordinal())) {<BR> logger.debug(message, throwable);<BR> }<BR> }<BR><BR> public void debug(LEVEL level, String message, Object[] objects) {<BR> if((logger.isDebugEnabled()) && (level.ordinal() <= debugLevel.ordinal())) {<BR> logger.debug(message, objects);<BR> }<BR> }<BR> <BR> // The highest value; intended for extremely important messages (e.g. fatal program errors).<BR> public void severe(String message) {<BR> if(logger.isErrorEnabled()) {<BR> logger.error(message);<BR> }<BR> }<BR> <BR> public void severe(String message, Throwable throwable) {<BR> if(logger.isErrorEnabled()) {<BR> logger.error(message, throwable);<BR> }<BR> }<BR> <BR> public void severe(String message, Object[] objects) {<BR> if(logger.isErrorEnabled()) {<BR> logger.error(message, objects);<BR> }<BR> }<BR> <BR> // Intended for warning messages.<BR> public void warning(String message) {<BR> if(logger.isWarnEnabled()) {<BR> logger.warn(message);<BR> }<BR> }<BR> <BR> public void warning(String message, Throwable throwable) {<BR> if(logger.isWarnEnabled()) {<BR> logger.warn(message, throwable);<BR> }<BR> }<BR> <BR> public void warning(String message, Object[] objects) {<BR> if(logger.isWarnEnabled()) {<BR> logger.warn(message, objects);<BR> }<BR> }<BR> <BR>}</DIV><BR />
<BR />
<HR />
<BR />
Notice: This email is confidential. If you are not the intended recipient, please notify the sender by return email and delete this message from your mail box without reading or copying it or any attachments.<BR />
<BR />
Attention: Ce courriel est confidentiel. Si vous n'êtes pas le destinataire prévu, veuillez en informer l'expéditeur par le courriel de retour et le supprimer immédiatement sans le lire ou le copier (incluant les pièces jointes, le cas échéant).<BR />
</body></html>