public class Logger extends Object
System.err. The default level is
LEVEL.INFO| Modifier | Constructor and Description |
|---|---|
protected |
Logger(String name)
Creates a new
Logger with the given name |
| Modifier and Type | Method and Description |
|---|---|
void |
addHandler(Handler handler)
Adds a Handler to receive logging messages
|
void |
config(String msg)
Logs a CONFIG message
|
void |
config(String msg,
Object[] params)
Log a CONFIG message, with an array of object arguments.
|
void |
config(String sourceClass,
String sourceMethod,
String msg)
Log a CONFIG message, specifying source class and method.
|
void |
config(String sourceClass,
String sourceMethod,
String msg,
Object[] params)
Log a CONFIG message, specifying source class and method, with an
array of object arguments.
|
void |
entering(String sourceClass,
String sourceMethod)
Log a procedure entry.
|
void |
entering(String sourceClass,
String sourceMethod,
Object[] params)
Log a procedure entry, with parameters.
|
void |
exiting(String sourceClass,
String sourceMethod)
Log a procedure return.
|
void |
exiting(String sourceClass,
String sourceMethod,
Object[] params)
Log a procedure return, with parameters.
|
void |
fine(String msg)
Logs a FINE message
|
void |
fine(String msg,
Object[] params)
Log a FINE message, with an array of object arguments.
|
void |
fine(String sourceClass,
String sourceMethod,
String msg)
Log a FINE message, specifying source class and method.
|
void |
fine(String sourceClass,
String sourceMethod,
String msg,
Object[] params)
Log a FINE message, specifying source class and method, with an
array of object arguments.
|
void |
finer(String msg)
Logs a FINER message
|
void |
finer(String msg,
Object[] params)
Log a FINER message, with an array of object arguments.
|
void |
finer(String sourceClass,
String sourceMethod,
String msg)
Log a FINER message, specifying source class and method.
|
void |
finer(String sourceClass,
String sourceMethod,
String msg,
Object[] params)
Log a FINER message, specifying source class and method, with an
array of object arguments.
|
void |
finest(String msg)
Logs a FINEST message
|
void |
finest(String msg,
Object[] params)
Log a FINEST message, with an array of object arguments.
|
void |
finest(String sourceClass,
String sourceMethod,
String msg)
Log a FINEST message, specifying source class and method.
|
void |
finest(String sourceClass,
String sourceMethod,
String msg,
Object[] params)
Log a FINEST message, specifying source class and method, with an
array of object arguments.
|
static String |
format(String format,
Object[] objs)
Formats a message.
|
Handler[] |
getHandlers()
Returns the Handlers associated with this logger
|
Level |
getLevel()
Returns the log level specifying which messages will be logged by
this logger.
|
static Logger |
getLogger(String name)
Returns the logger with the given name
|
void |
info(String msg)
Logs a INFO message
|
void |
info(String msg,
Object[] params)
Log a INFO message, with an array of object arguments.
|
void |
info(String sourceClass,
String sourceMethod,
String msg)
Log a INFO message, specifying source class and method.
|
void |
info(String sourceClass,
String sourceMethod,
String msg,
Object[] params)
Log a INFO message, specifying source class and method, with an
array of object arguments.
|
boolean |
isLoggable(Level msgLevel)
Check if a message of the given level would actually be logged by
this logger.
|
void |
log(Level msgLevel,
String msg)
Logs a message
|
void |
log(Level msgLevel,
String msg,
Object[] params)
Log a message, with an array of object arguments.
|
void |
log(Level msgLevel,
String sourceClass,
String sourceMethod,
String msg)
Log a message, specifying source class and method.
|
void |
log(Level msgLevel,
String sourceClass,
String sourceMethod,
String msg,
Object[] params)
Log a message, specifying source class and method, with an
array of object arguments.
|
void |
log(Level msgLevel,
String sourceClass,
String sourceMethod,
String msg,
Throwable thrown)
Log a message, specifying source class and method, with
associated Throwable information.
|
void |
log(Level msgLevel,
String msg,
Throwable thrown)
Log a message, with associated Throwable information.
|
void |
log(LogRecord record)
Prints the given log record to System.err
|
void |
removeHandler(Handler handler)
Removes a Handler from this logger
|
void |
setLevel(Level level)
Sets the log level specifying which messages will be logged by
this logger.
|
void |
severe(String msg)
Logs a SEVERE message
|
void |
severe(String msg,
Object[] params)
Log a SEVERE message, with an array of object arguments.
|
void |
severe(String sourceClass,
String sourceMethod,
String msg)
Log a SEVERE message, specifying source class and method.
|
void |
severe(String sourceClass,
String sourceMethod,
String msg,
Object[] params)
Log a SEVERE message, specifying source class and method, with an
array of object arguments.
|
void |
throwing(String sourceClass,
String sourceMethod,
Throwable thrown)
Log throwing an exception.
|
void |
warning(String msg)
Logs a WARNING message
|
void |
warning(String msg,
Object[] params)
Log a WARNING message, with an array of object arguments.
|
void |
warning(String sourceClass,
String sourceMethod,
String msg)
Log a WARNING message, specifying source class and method.
|
void |
warning(String sourceClass,
String sourceMethod,
String msg,
Object[] params)
Log a WARNING message, specifying source class and method, with an
array of object arguments.
|
protected Logger(String name)
Logger with the given namepublic void addHandler(Handler handler)
public Handler[] getHandlers()
public void removeHandler(Handler handler)
public Level getLevel()
public void setLevel(Level level)
public boolean isLoggable(Level msgLevel)
public void log(LogRecord record)
public void config(String msg)
public void config(String msg, Object[] params)
public void config(String sourceClass, String sourceMethod, String msg)
public void config(String sourceClass, String sourceMethod, String msg, Object[] params)
public void entering(String sourceClass, String sourceMethod, Object[] params)
public void exiting(String sourceClass, String sourceMethod, Object[] params)
public void fine(String msg)
public void fine(String msg, Object[] params)
public void fine(String sourceClass, String sourceMethod, String msg)
public void fine(String sourceClass, String sourceMethod, String msg, Object[] params)
public void finer(String msg)
public void finer(String msg, Object[] params)
public void finer(String sourceClass, String sourceMethod, String msg)
public void finer(String sourceClass, String sourceMethod, String msg, Object[] params)
public void finest(String msg)
public void finest(String msg, Object[] params)
public void finest(String sourceClass, String sourceMethod, String msg)
public void finest(String sourceClass, String sourceMethod, String msg, Object[] params)
public void info(String msg)
public void info(String msg, Object[] params)
public void info(String sourceClass, String sourceMethod, String msg)
public void info(String sourceClass, String sourceMethod, String msg, Object[] params)
public void log(Level msgLevel, String msg, Object[] params)
public void log(Level msgLevel, String sourceClass, String sourceMethod, String msg)
public void log(Level msgLevel, String sourceClass, String sourceMethod, String msg, Object[] params)
public void log(Level msgLevel, String sourceClass, String sourceMethod, String msg, Throwable thrown)
public void log(Level msgLevel, String msg, Throwable thrown)
public void severe(String msg)
public void severe(String msg, Object[] params)
public void severe(String sourceClass, String sourceMethod, String msg)
public void severe(String sourceClass, String sourceMethod, String msg, Object[] params)
public void throwing(String sourceClass, String sourceMethod, Throwable thrown)
public void warning(String msg)
public void warning(String msg, Object[] params)
public void warning(String sourceClass, String sourceMethod, String msg)
public void warning(String sourceClass, String sourceMethod, String msg, Object[] params)
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.