com.pelzer.util
Class Logging.Logger

java.lang.Object
  extended by com.pelzer.util.Logging.Logger
All Implemented Interfaces:
Serializable
Enclosing class:
Logging

public static class Logging.Logger
extends Object
implements Serializable

Wrapper class around our logging... Will allow us to migrate and add functionality without breaking things in the future.

See Also:
Serialized Form

Method Summary
 void debug(String message, Object... replacementTokens)
          Takes a message and an unspecified number of tokens to put into that message, looking for the pattern "{}".
 void debug(String message, Throwable ex, Object... replacementTokens)
          Takes a message and an unspecified number of tokens to put into that message, looking for the pattern "{}".
 void error(String message, Object... replacementTokens)
          Takes a message and an unspecified number of tokens to put into that message, looking for the pattern "{}".
 void error(String message, Throwable ex, Object... replacementTokens)
          Takes a message and an unspecified number of tokens to put into that message, looking for the pattern "{}".
 void fatal(String message, Object... replacementTokens)
          Takes a message and an unspecified number of tokens to put into that message, looking for the pattern "{}".
 void fatal(String message, Throwable ex, Object... replacementTokens)
          Takes a message and an unspecified number of tokens to put into that message, looking for the pattern "{}".
 void info(String message, Object... replacementTokens)
          Takes a message and an unspecified number of tokens to put into that message, looking for the pattern "{}".
 void info(String message, Throwable ex, Object... replacementTokens)
          Takes a message and an unspecified number of tokens to put into that message, looking for the pattern "{}".
 boolean isDebugEnabled()
           
 boolean isInfoEnabled()
           
 void mute()
          Mutes this particular logger.
 void unmute()
          Unmutes this particular logger, or does nothing if this logger is not currently muted.
 void warn(String message, Object... replacementTokens)
          Takes a message and an unspecified number of tokens to put into that message, looking for the pattern "{}".
 void warn(String message, Throwable ex, Object... replacementTokens)
          Takes a message and an unspecified number of tokens to put into that message, looking for the pattern "{}".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

mute

public void mute()
Mutes this particular logger. Has no effect if already muted (safe to call more than once)


unmute

public void unmute()
Unmutes this particular logger, or does nothing if this logger is not currently muted.


isDebugEnabled

public boolean isDebugEnabled()

isInfoEnabled

public boolean isInfoEnabled()

debug

public void debug(String message,
                  Object... replacementTokens)
Takes a message and an unspecified number of tokens to put into that message, looking for the pattern "{}". For instance, logging something like debug("Attempt {} of {}.",1,2) would put out "Attempt 1 of 2". If you have an exception, put it after the message but before the replacement tokens, ie error("Failed in attempt {}", ex, 2). The reason to use this mechanism instead of "Failed in attempt "+2 (for instance) is that the overhead of String concatenation is internally skipped if isDebugEnabled() or isInfoEnabled() are false, significantly improving debug performance without resorting the bulky:
 if (log.isDebugEnabled())
   log.debug("Foo" + " is the answer!");
 
The new hotness looks like this:
 log.debug("Foo {}", "is the answer!");
 


debug

public void debug(String message,
                  Throwable ex,
                  Object... replacementTokens)
Takes a message and an unspecified number of tokens to put into that message, looking for the pattern "{}". For instance, logging something like debug("Attempt {} of {}.",1,2) would put out "Attempt 1 of 2". If you have an exception, put it after the message but before the replacement tokens, ie error("Failed in attempt {}", ex, 2). The reason to use this mechanism instead of "Failed in attempt "+2 (for instance) is that the overhead of String concatenation is internally skipped if isDebugEnabled() or isInfoEnabled() are false, significantly improving debug performance without resorting the bulky:
 if (log.isDebugEnabled())
   log.debug("Foo" + " is the answer!");
 
The new hotness looks like this:
 log.debug("Foo {}", "is the answer!");
 


info

public void info(String message,
                 Object... replacementTokens)
Takes a message and an unspecified number of tokens to put into that message, looking for the pattern "{}". For instance, logging something like debug("Attempt {} of {}.",1,2) would put out "Attempt 1 of 2". If you have an exception, put it after the message but before the replacement tokens, ie error("Failed in attempt {}", ex, 2). The reason to use this mechanism instead of "Failed in attempt "+2 (for instance) is that the overhead of String concatenation is internally skipped if isDebugEnabled() or isInfoEnabled() are false, significantly improving debug performance without resorting the bulky:
 if (log.isDebugEnabled())
   log.debug("Foo" + " is the answer!");
 
The new hotness looks like this:
 log.debug("Foo {}", "is the answer!");
 


info

public void info(String message,
                 Throwable ex,
                 Object... replacementTokens)
Takes a message and an unspecified number of tokens to put into that message, looking for the pattern "{}". For instance, logging something like debug("Attempt {} of {}.",1,2) would put out "Attempt 1 of 2". If you have an exception, put it after the message but before the replacement tokens, ie error("Failed in attempt {}", ex, 2). The reason to use this mechanism instead of "Failed in attempt "+2 (for instance) is that the overhead of String concatenation is internally skipped if isDebugEnabled() or isInfoEnabled() are false, significantly improving debug performance without resorting the bulky:
 if (log.isDebugEnabled())
   log.debug("Foo" + " is the answer!");
 
The new hotness looks like this:
 log.debug("Foo {}", "is the answer!");
 


warn

public void warn(String message,
                 Object... replacementTokens)
Takes a message and an unspecified number of tokens to put into that message, looking for the pattern "{}". For instance, logging something like debug("Attempt {} of {}.",1,2) would put out "Attempt 1 of 2". If you have an exception, put it after the message but before the replacement tokens, ie error("Failed in attempt {}", ex, 2). The reason to use this mechanism instead of "Failed in attempt "+2 (for instance) is that the overhead of String concatenation is internally skipped if isDebugEnabled() or isInfoEnabled() are false, significantly improving debug performance without resorting the bulky:
 if (log.isDebugEnabled())
   log.debug("Foo" + " is the answer!");
 
The new hotness looks like this:
 log.debug("Foo {}", "is the answer!");
 


warn

public void warn(String message,
                 Throwable ex,
                 Object... replacementTokens)
Takes a message and an unspecified number of tokens to put into that message, looking for the pattern "{}". For instance, logging something like debug("Attempt {} of {}.",1,2) would put out "Attempt 1 of 2". If you have an exception, put it after the message but before the replacement tokens, ie error("Failed in attempt {}", ex, 2). The reason to use this mechanism instead of "Failed in attempt "+2 (for instance) is that the overhead of String concatenation is internally skipped if isDebugEnabled() or isInfoEnabled() are false, significantly improving debug performance without resorting the bulky:
 if (log.isDebugEnabled())
   log.debug("Foo" + " is the answer!");
 
The new hotness looks like this:
 log.debug("Foo {}", "is the answer!");
 


error

public void error(String message,
                  Object... replacementTokens)
Takes a message and an unspecified number of tokens to put into that message, looking for the pattern "{}". For instance, logging something like debug("Attempt {} of {}.",1,2) would put out "Attempt 1 of 2". If you have an exception, put it after the message but before the replacement tokens, ie error("Failed in attempt {}", ex, 2). The reason to use this mechanism instead of "Failed in attempt "+2 (for instance) is that the overhead of String concatenation is internally skipped if isDebugEnabled() or isInfoEnabled() are false, significantly improving debug performance without resorting the bulky:
 if (log.isDebugEnabled())
   log.debug("Foo" + " is the answer!");
 
The new hotness looks like this:
 log.debug("Foo {}", "is the answer!");
 


error

public void error(String message,
                  Throwable ex,
                  Object... replacementTokens)
Takes a message and an unspecified number of tokens to put into that message, looking for the pattern "{}". For instance, logging something like debug("Attempt {} of {}.",1,2) would put out "Attempt 1 of 2". If you have an exception, put it after the message but before the replacement tokens, ie error("Failed in attempt {}", ex, 2). The reason to use this mechanism instead of "Failed in attempt "+2 (for instance) is that the overhead of String concatenation is internally skipped if isDebugEnabled() or isInfoEnabled() are false, significantly improving debug performance without resorting the bulky:
 if (log.isDebugEnabled())
   log.debug("Foo" + " is the answer!");
 
The new hotness looks like this:
 log.debug("Foo {}", "is the answer!");
 


fatal

public void fatal(String message,
                  Object... replacementTokens)
Takes a message and an unspecified number of tokens to put into that message, looking for the pattern "{}". For instance, logging something like debug("Attempt {} of {}.",1,2) would put out "Attempt 1 of 2". If you have an exception, put it after the message but before the replacement tokens, ie error("Failed in attempt {}", ex, 2). The reason to use this mechanism instead of "Failed in attempt "+2 (for instance) is that the overhead of String concatenation is internally skipped if isDebugEnabled() or isInfoEnabled() are false, significantly improving debug performance without resorting the bulky:
 if (log.isDebugEnabled())
   log.debug("Foo" + " is the answer!");
 
The new hotness looks like this:
 log.debug("Foo {}", "is the answer!");
 


fatal

public void fatal(String message,
                  Throwable ex,
                  Object... replacementTokens)
Takes a message and an unspecified number of tokens to put into that message, looking for the pattern "{}". For instance, logging something like debug("Attempt {} of {}.",1,2) would put out "Attempt 1 of 2". If you have an exception, put it after the message but before the replacement tokens, ie error("Failed in attempt {}", ex, 2). The reason to use this mechanism instead of "Failed in attempt "+2 (for instance) is that the overhead of String concatenation is internally skipped if isDebugEnabled() or isInfoEnabled() are false, significantly improving debug performance without resorting the bulky:
 if (log.isDebugEnabled())
   log.debug("Foo" + " is the answer!");
 
The new hotness looks like this:
 log.debug("Foo {}", "is the answer!");
 



Copyright © 2012. All Rights Reserved.