<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>Take a look at XLogger in slf4j-ext.<div><br></div><div>Out of curiosity, what do you need the wrapper for?</div><div><br></div>Ralph</div><div><br></div><div>On Feb 20, 2009, at 2:58 PM, Ashley Westwell wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div style="font: normal normal normal 10pt/normal Tahoma, Verdana, sans-serif; "><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> <span class="Apple-converted-space"> </span><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> <span class="Apple-converted-space"> </span><br> }<br> <span class="Apple-converted-space"> </span><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> <span class="Apple-converted-space"> </span><br> public void info(String message) {<br> logger.info(message);<br> }<br> <span class="Apple-converted-space"> </span><br> public void info(String message, Throwable throwable) {<br> logger.info(message, throwable);<br> }<br> <span class="Apple-converted-space"> </span><br> public void info(String message, Object[] objects) {<br> if(logger.isInfoEnabled()) {<br> logger.info(message, objects);<br> }<br> }<br> <span class="Apple-converted-space"> </span><br> public void info(LEVEL level, String message) {<br> if((logger.isInfoEnabled()) && (level.ordinal() <= infoLevel.ordinal())) {<br> logger.info(message);<br> }<br> }<br> <span class="Apple-converted-space"> </span><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> <span class="Apple-converted-space"> </span><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> <span class="Apple-converted-space"> </span><br> // Debug messages.<br> public void debug(String message) {<br> if(logger.isDebugEnabled()) {<br> logger.debug(message);<br> }<br> <span class="Apple-converted-space"> </span><br> }<br> public void debug(String message, Throwable throwable) {<br> if(logger.isDebugEnabled()) {<br> logger.debug(message, throwable);<br> }<br> }<br> <span class="Apple-converted-space"> </span><br> public void debug(String message, Object[] objects) {<br> if(logger.isDebugEnabled()) {<br> logger.debug(message, objects);<br> }<br> }<br> <span class="Apple-converted-space"> </span><br> public void debug(LEVEL level, String message) {<br> if((logger.isDebugEnabled()) && (level.ordinal() <= debugLevel.ordinal())) {<br> logger.debug(message);<br> }<br> }<br> <span class="Apple-converted-space"> </span><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> <span class="Apple-converted-space"> </span><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> <span class="Apple-converted-space"> </span><br> public void severe(String message, Throwable throwable) {<br> if(logger.isErrorEnabled()) {<br> logger.error(message, throwable);<br> }<br> }<br> <span class="Apple-converted-space"> </span><br> public void severe(String message, Object[] objects) {<br> if(logger.isErrorEnabled()) {<br> logger.error(message, objects);<br> }<br> }<br> <span class="Apple-converted-space"> </span><br> // Intended for warning messages.<br> public void warning(String message) {<br> if(logger.isWarnEnabled()) {<br> logger.warn(message);<br> }<br> }<br> <span class="Apple-converted-space"> </span><br> public void warning(String message, Throwable throwable) {<br> if(logger.isWarnEnabled()) {<br> logger.warn(message, throwable);<br> }<br> }<br> <span class="Apple-converted-space"> </span><br> public void warning(String message, Object[] objects) {<br> if(logger.isWarnEnabled()) {<br> logger.warn(message, objects);<br> }<br> }<br> <span class="Apple-converted-space"> </span><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>_______________________________________________<br>dev mailing list<br><a href="mailto:dev@slf4j.org">dev@slf4j.org</a><br><a href="http://www.slf4j.org/mailman/listinfo/dev">http://www.slf4j.org/mailman/listinfo/dev</a></div></span></blockquote></div><br></body></html>