Methods Summary |
---|
final void | addChild(java.util.logging.Logger logger)
childs.add(logger);
|
public void | addHandler(java.util.logging.Handler handler)Adds a handler to this logger. The {@code name} will be fed with log
records received by this logger.
if (null == handler) {
// logging.A=The 'handler' parameter is null.
throw new NullPointerException(Messages.getString("logging.A")); //$NON-NLS-1$
}
// Anonymous loggers can always add handlers
if (this.isNamed) {
LogManager.getLogManager().checkAccess();
}
initHandler();
synchronized(this){
this.handlers.add(handler);
}
|
public void | config(java.lang.String msg)Logs a message of level {@code Level.CONFIG}; the message is transmitted
to all subscribed handlers.
if (internalIsLoggable(Level.CONFIG)) {
LogRecord record = new LogRecord(Level.CONFIG, msg);
record.setLoggerName(this.name);
setResourceBundle(record);
log(record);
}
|
public void | entering(java.lang.String sourceClass, java.lang.String sourceMethod)Logs a message indicating that a method has been entered. A log record
with log level {@code Level.FINER}, log message "ENTRY", the specified
source class name and source method name is submitted for logging.
if (internalIsLoggable(Level.FINER)) {
LogRecord record = new LogRecord(Level.FINER, "ENTRY"); //$NON-NLS-1$
record.setLoggerName(this.name);
record.setSourceClassName(sourceClass);
record.setSourceMethodName(sourceMethod);
setResourceBundle(record);
log(record);
}
|
public void | entering(java.lang.String sourceClass, java.lang.String sourceMethod, java.lang.Object param)Logs a message indicating that a method has been entered. A log record
with log level {@code Level.FINER}, log message "ENTRY", the specified
source class name, source method name and one parameter is submitted for
logging.
if (internalIsLoggable(Level.FINER)) {
LogRecord record = new LogRecord(Level.FINER, "ENTRY" + " {0}"); //$NON-NLS-1$ //$NON-NLS-2$
record.setLoggerName(this.name);
record.setSourceClassName(sourceClass);
record.setSourceMethodName(sourceMethod);
record.setParameters(new Object[] { param });
setResourceBundle(record);
log(record);
}
|
public void | entering(java.lang.String sourceClass, java.lang.String sourceMethod, java.lang.Object[] params)Logs a message indicating that a method has been entered. A log record
with log level {@code Level.FINER}, log message "ENTRY", the specified
source class name, source method name and array of parameters is
submitted for logging.
if (internalIsLoggable(Level.FINER)) {
String msg = "ENTRY"; //$NON-NLS-1$
if (null != params) {
StringBuilder msgBuffer = new StringBuilder("ENTRY"); //$NON-NLS-1$
for (int i = 0; i < params.length; i++) {
msgBuffer.append(" {" + i + "}"); //$NON-NLS-1$ //$NON-NLS-2$
}
msg = msgBuffer.toString();
}
LogRecord record = new LogRecord(Level.FINER, msg);
record.setLoggerName(this.name);
record.setSourceClassName(sourceClass);
record.setSourceMethodName(sourceMethod);
record.setParameters(params);
setResourceBundle(record);
log(record);
}
|
public void | exiting(java.lang.String sourceClass, java.lang.String sourceMethod)Logs a message indicating that a method is exited. A log record with log
level {@code Level.FINER}, log message "RETURN", the specified source
class name and source method name is submitted for logging.
if (internalIsLoggable(Level.FINER)) {
LogRecord record = new LogRecord(Level.FINER, "RETURN"); //$NON-NLS-1$
record.setLoggerName(this.name);
record.setSourceClassName(sourceClass);
record.setSourceMethodName(sourceMethod);
setResourceBundle(record);
log(record);
}
|
public void | exiting(java.lang.String sourceClass, java.lang.String sourceMethod, java.lang.Object result)Logs a message indicating that a method is exited. A log record with log
level {@code Level.FINER}, log message "RETURN", the specified source
class name, source method name and return value is submitted for logging.
if (internalIsLoggable(Level.FINER)) {
LogRecord record = new LogRecord(Level.FINER, "RETURN" + " {0}"); //$NON-NLS-1$ //$NON-NLS-2$
record.setLoggerName(this.name);
record.setSourceClassName(sourceClass);
record.setSourceMethodName(sourceMethod);
record.setParameters(new Object[] { result });
setResourceBundle(record);
log(record);
}
|
public void | fine(java.lang.String msg)Logs a message of level {@code Level.FINE}; the message is transmitted
to all subscribed handlers.
if (internalIsLoggable(Level.FINE)) {
LogRecord record = new LogRecord(Level.FINE, msg);
record.setLoggerName(this.name);
setResourceBundle(record);
log(record);
}
|
public void | finer(java.lang.String msg)Logs a message of level {@code Level.FINER}; the message is transmitted
to all subscribed handlers.
if (internalIsLoggable(Level.FINER)) {
LogRecord record = new LogRecord(Level.FINER, msg);
record.setLoggerName(this.name);
setResourceBundle(record);
log(record);
}
|
public void | finest(java.lang.String msg)Logs a message of level {@code Level.FINEST}; the message is transmitted
to all subscribed handlers.
if (internalIsLoggable(Level.FINEST)) {
LogRecord record = new LogRecord(Level.FINEST, msg);
record.setLoggerName(this.name);
setResourceBundle(record);
log(record);
}
|
private void | forceChildsToInherit()
for (Logger child : childs) {
if (null == child.levelObjVal) { // should inherit
child.setLevelImpl(null);
}
}
|
public static java.util.logging.Logger | getAnonymousLogger()Gets an anonymous logger to use internally in a thread. Anonymous loggers
are not registered in the log manager's namespace. No security checks
will be performed when updating an anonymous logger's control settings.
The anonymous loggers' parent is set to be the root logger. This way it
inherits the default logging level and handlers from the root logger.
return getAnonymousLogger(null);
|
public static java.util.logging.Logger | getAnonymousLogger(java.lang.String resourceBundleName)Gets an anonymous logger to use internally in a thread. Anonymous loggers
are not registered in the log manager's namespace. No security checks
will be performed when updating an anonymous logger's control settings.
The anonymous loggers' parent is set to be the root logger. This way it
inherits default logging level and handlers from the root logger.
final Logger l = new Logger(null, resourceBundleName);
l.isNamed = false;
l.internalSetParent(LogManager.getLogManager().getLogger("")); //$NON-NLS-1$
return l;
|
public java.util.logging.Filter | getFilter()Gets the filter used by this logger.
return this.filter;
|
public java.util.logging.Handler[] | getHandlers()Gets all the handlers associated with this logger.
initHandler();
synchronized(this){
return handlers.toArray(new Handler[handlers.size()]);
}
|
public java.util.logging.Level | getLevel()Gets the logging level of this logger. A {@code null} level indicates
that this logger inherits its parent's level.
return levelObjVal;
|
public static java.util.logging.Logger | getLogger(java.lang.String name, java.lang.String resourceBundleName)Gets a named logger associated with the supplied resource bundle. The
resource bundle will be used to localize logging messages.
return getLoggerWithRes(name, resourceBundleName, true);
|
public static java.util.logging.Logger | getLogger(java.lang.String name)Gets a named logger. The returned logger may already exist or may be
newly created. In the latter case, its level will be set to the
configured level according to the {@code LogManager}'s properties.
return getLoggerWithRes(name, null, false);
|
private static java.util.logging.Logger | getLoggerWithRes(java.lang.String name, java.lang.String resourceBundleName, boolean hasResourceName)
LogManager man = LogManager.getLogManager();
Logger l = null;
synchronized (man) {
// Try to find an existing logger with the specified name
l = man.getLogger(name);
// If no existing logger with the same name, create a new one
if (null == l) {
l = new Logger(name, resourceBundleName);
man.addLogger(l);
return l;
}
}
if (hasResourceName) {
updateResourceBundle(l, resourceBundleName);
}
return l;
|
public java.lang.String | getName()Gets the name of this logger, {@code null} for anonymous loggers.
return this.name;
|
public java.util.logging.Logger | getParent()Gets the nearest parent of this logger in the namespace, a {@code null}
value will be returned if called on the root logger.
return parent;
|
public java.util.ResourceBundle | getResourceBundle()Gets the loaded resource bundle used by this logger to localize logging
messages. If the value is {@code null}, the parent's resource bundle will be
inherited.
return this.resBundle;
|
public java.lang.String | getResourceBundleName()Gets the name of the loaded resource bundle used by this logger to
localize logging messages. If the value is {@code null}, the parent's resource
bundle name will be inherited.
return this.resBundleName;
|
public boolean | getUseParentHandlers()Gets the flag which indicates whether to use the handlers of this
logger's parent to publish incoming log records, potentially recursively
up the namespace.
return this.notifyParentHandlers;
|
public void | info(java.lang.String msg)Logs a message of level {@code Level.INFO}; the message is transmitted
to all subscribed handlers.
if (internalIsLoggable(Level.INFO)) {
LogRecord record = new LogRecord(Level.INFO, msg);
record.setLoggerName(this.name);
setResourceBundle(record);
log(record);
}
|
private void | initHandler()
if(!handlerInited){
synchronized (this) {
if (!handlerInited) {
// BEGIN android-added
/*
* Force LogManager to be initialized, since its
* class init code performs necessary one-time setup.
*/
LogManager.getLogManager();
// END android-added
if (handlers == null) {
handlers = new ArrayList<Handler>();
}
if (manager == null) {
return;
}
String handlerStr = manager
.getProperty("".equals(name) ? "handlers" : name + ".handlers"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
if (null == handlerStr) {
return;
}
StringTokenizer st = new StringTokenizer(handlerStr, " "); //$NON-NLS-1$
while (st.hasMoreTokens()) {
String handlerName = st.nextToken();
// BEGIN android-changed
// deal with non-existing handler
try {
Handler handler = (Handler) LogManager
.getInstanceByClass(handlerName);
handlers.add(handler);
String level = manager.getProperty(handlerName
+ ".level"); //$NON-NLS-1$
if (null != level) {
handler.setLevel(Level.parse(level));
}
} catch (Exception ex) {
ex.printStackTrace();
}
// END android-changed
}
handlerInited = true;
}
}
}
|
private boolean | internalIsLoggable(java.util.logging.Level l)This method is for compatibility. Tests written to the reference
implementation API imply that the isLoggable() method is not called
directly. This behavior is important because subclass may override
isLoggable() method, so that affect the result of log methods.
int effectiveLevel = levelIntVal;
if (effectiveLevel == Level.OFF.intValue()) {
// always return false if the effective level is off
return false;
}
return l.intValue() >= effectiveLevel;
|
void | internalSetParent(java.util.logging.Logger newParent)Sets the parent of this logger in the namespace. This method should
usually be used by the {@code LogManager} object only. This method does
not check security.
//All hierarchy related modifications should get LogManager lock at first
synchronized(LogManager.getLogManager()){
parent = newParent;
// -- update level after setting a parent.
// -- if level == null we should inherit the parent's level
if (null == levelObjVal) {
setLevelImpl(levelObjVal);
}
newParent.addChild(this);
}
|
public boolean | isLoggable(java.util.logging.Level l)Determines whether this logger will actually log messages of the
specified level. The effective level used to do the determination may be
inherited from its parent. The default level is {@code Level.INFO}.
return internalIsLoggable(l);
|
static java.util.ResourceBundle | loadResourceBundle(java.lang.String resourceBundleName)Load the specified resource bundle, use privileged code.
// try context class loader to load the resource
ClassLoader cl = AccessController.doPrivileged(
new PrivilegedAction<ClassLoader>() {
public ClassLoader run() {
return Thread.currentThread().getContextClassLoader();
}
});
if (null != cl) {
try {
return ResourceBundle.getBundle(resourceBundleName, Locale
.getDefault(), cl);
} catch (MissingResourceException e) {
// Failed to load using context classloader, ignore
}
}
// try system class loader to load the resource
cl = AccessController.doPrivileged(
new PrivilegedAction<ClassLoader>() {
public ClassLoader run() {
return ClassLoader.getSystemClassLoader();
}
});
if (null != cl) {
try {
return ResourceBundle.getBundle(resourceBundleName, Locale
.getDefault(), cl);
} catch (MissingResourceException e) {
// Failed to load using system classloader, ignore
}
}
// try all class loaders up the class stack
final Class<?>[] classes = AccessController
.doPrivileged(new PrivilegedAction<Class<?>[]>() {
public Class<?>[] run() {
return (new PrivateSecurityManager())
.privateGetClassContext();
}
});
// the first class, which is PrivateSecurityManager, is skipped
for (int i = 1; i < classes.length; i++) {
final int index = i;
try {
cl = AccessController.doPrivileged(
new PrivilegedAction<ClassLoader>() {
public ClassLoader run() {
return classes[index].getClassLoader();
}
});
if (null == cl) {
continue;
}
return ResourceBundle.getBundle(resourceBundleName, Locale
.getDefault(), cl);
} catch (MissingResourceException e) {
// Failed to load using the current class's classloader, ignore
}
}
// logging.8=Failed to load the specified resource bundle "{0}".
throw new MissingResourceException(Messages.getString("logging.8", //$NON-NLS-1$
resourceBundleName), resourceBundleName, null);
|
public void | log(java.util.logging.Level logLevel, java.lang.String msg)Logs a message of the specified level. The message is transmitted to all
subscribed handlers.
if (internalIsLoggable(logLevel)) {
LogRecord record = new LogRecord(logLevel, msg);
record.setLoggerName(this.name);
setResourceBundle(record);
log(record);
}
|
public void | log(java.util.logging.Level logLevel, java.lang.String msg, java.lang.Object param)Logs a message of the specified level with the supplied parameter. The
message is then transmitted to all subscribed handlers.
if (internalIsLoggable(logLevel)) {
LogRecord record = new LogRecord(logLevel, msg);
record.setLoggerName(this.name);
record.setParameters(new Object[] { param });
setResourceBundle(record);
log(record);
}
|
public void | log(java.util.logging.Level logLevel, java.lang.String msg, java.lang.Object[] params)Logs a message of the specified level with the supplied parameter array.
The message is then transmitted to all subscribed handlers.
if (internalIsLoggable(logLevel)) {
LogRecord record = new LogRecord(logLevel, msg);
record.setLoggerName(this.name);
record.setParameters(params);
setResourceBundle(record);
log(record);
}
|
public void | log(java.util.logging.Level logLevel, java.lang.String msg, java.lang.Throwable thrown)Logs a message of the specified level with the supplied {@code Throwable}
object. The message is then transmitted to all subscribed handlers.
if (internalIsLoggable(logLevel)) {
LogRecord record = new LogRecord(logLevel, msg);
record.setLoggerName(this.name);
record.setThrown(thrown);
setResourceBundle(record);
log(record);
}
|
public void | log(java.util.logging.LogRecord record)Logs a given log record. Only records with a logging level that is equal
or greater than this logger's level will be submitted to this logger's
handlers for logging. If {@code getUseParentHandlers()} returns {@code
true}, the log record will also be submitted to the handlers of this
logger's parent, potentially recursively up the namespace.
Since all other log methods call this method to actually perform the
logging action, subclasses of this class can override this method to
catch all logging activities.
if (internalIsLoggable(record.getLevel())) {
// apply the filter if any
Filter f = filter;
if (null != f && !f.isLoggable(record)) {
return;
}
initHandler();
/*
* call the handlers of this logger, throw any exception that
* occurs
*/
Handler[] allHandlers = getHandlers();
for (Handler element : allHandlers) {
element.publish(record);
}
// call the parent's handlers if set useParentHandlers
Logger temp = this;
Logger theParent = temp.parent;
while (theParent != null && temp.getUseParentHandlers()) {
Handler[] ha = theParent.getHandlers();
for (Handler element : ha) {
element.publish(record);
}
temp = theParent;
theParent = temp.parent;
}
}
|
public void | logp(java.util.logging.Level logLevel, java.lang.String sourceClass, java.lang.String sourceMethod, java.lang.String msg)Logs a message of the given level with the specified source class name
and source method name.
if (internalIsLoggable(logLevel)) {
LogRecord record = new LogRecord(logLevel, msg);
record.setLoggerName(this.name);
record.setSourceClassName(sourceClass);
record.setSourceMethodName(sourceMethod);
setResourceBundle(record);
log(record);
}
|
public void | logp(java.util.logging.Level logLevel, java.lang.String sourceClass, java.lang.String sourceMethod, java.lang.String msg, java.lang.Object param)Logs a message of the given level with the specified source class name,
source method name and parameter.
if (internalIsLoggable(logLevel)) {
LogRecord record = new LogRecord(logLevel, msg);
record.setLoggerName(this.name);
record.setSourceClassName(sourceClass);
record.setSourceMethodName(sourceMethod);
record.setParameters(new Object[] { param });
setResourceBundle(record);
log(record);
}
|
public void | logp(java.util.logging.Level logLevel, java.lang.String sourceClass, java.lang.String sourceMethod, java.lang.String msg, java.lang.Object[] params)Logs a message of the given level with the specified source class name,
source method name and parameter array.
if (internalIsLoggable(logLevel)) {
LogRecord record = new LogRecord(logLevel, msg);
record.setLoggerName(this.name);
record.setSourceClassName(sourceClass);
record.setSourceMethodName(sourceMethod);
record.setParameters(params);
setResourceBundle(record);
log(record);
}
|
public void | logp(java.util.logging.Level logLevel, java.lang.String sourceClass, java.lang.String sourceMethod, java.lang.String msg, java.lang.Throwable thrown)Logs a message of the given level with the specified source class name,
source method name and {@code Throwable} object.
if (internalIsLoggable(logLevel)) {
LogRecord record = new LogRecord(logLevel, msg);
record.setLoggerName(this.name);
record.setSourceClassName(sourceClass);
record.setSourceMethodName(sourceMethod);
record.setThrown(thrown);
setResourceBundle(record);
log(record);
}
|
public void | logrb(java.util.logging.Level logLevel, java.lang.String sourceClass, java.lang.String sourceMethod, java.lang.String bundleName, java.lang.String msg)Logs a message of the given level with the specified source class name
and source method name, using the given resource bundle to localize the
message. If {@code bundleName} is null, the empty string or not valid then
the message is not localized.
if (internalIsLoggable(logLevel)) {
LogRecord record = new LogRecord(logLevel, msg);
if (null != bundleName) {
try {
record.setResourceBundle(loadResourceBundle(bundleName));
} catch (MissingResourceException e) {
// ignore
}
record.setResourceBundleName(bundleName);
}
record.setLoggerName(this.name);
record.setSourceClassName(sourceClass);
record.setSourceMethodName(sourceMethod);
log(record);
}
|
public void | logrb(java.util.logging.Level logLevel, java.lang.String sourceClass, java.lang.String sourceMethod, java.lang.String bundleName, java.lang.String msg, java.lang.Object param)Logs a message of the given level with the specified source class name,
source method name and parameter, using the given resource bundle to
localize the message. If {@code bundleName} is null, the empty string
or not valid then the message is not localized.
if (internalIsLoggable(logLevel)) {
LogRecord record = new LogRecord(logLevel, msg);
if (null != bundleName) {
try {
record.setResourceBundle(loadResourceBundle(bundleName));
} catch (MissingResourceException e) {
// ignore
}
record.setResourceBundleName(bundleName);
}
record.setLoggerName(this.name);
record.setSourceClassName(sourceClass);
record.setSourceMethodName(sourceMethod);
record.setParameters(new Object[] { param });
log(record);
}
|
public void | logrb(java.util.logging.Level logLevel, java.lang.String sourceClass, java.lang.String sourceMethod, java.lang.String bundleName, java.lang.String msg, java.lang.Object[] params)Logs a message of the given level with the specified source class name,
source method name and parameter array, using the given resource bundle
to localize the message. If {@code bundleName} is null, the empty string
or not valid then the message is not localized.
if (internalIsLoggable(logLevel)) {
LogRecord record = new LogRecord(logLevel, msg);
if (null != bundleName) {
try {
record.setResourceBundle(loadResourceBundle(bundleName));
} catch (MissingResourceException e) {
// ignore
}
record.setResourceBundleName(bundleName);
}
record.setLoggerName(this.name);
record.setSourceClassName(sourceClass);
record.setSourceMethodName(sourceMethod);
record.setParameters(params);
log(record);
}
|
public void | logrb(java.util.logging.Level logLevel, java.lang.String sourceClass, java.lang.String sourceMethod, java.lang.String bundleName, java.lang.String msg, java.lang.Throwable thrown)Logs a message of the given level with the specified source class name,
source method name and {@code Throwable} object, using the given resource
bundle to localize the message. If {@code bundleName} is null, the empty
string or not valid then the message is not localized.
if (internalIsLoggable(logLevel)) {
LogRecord record = new LogRecord(logLevel, msg);
if (null != bundleName) {
try {
record.setResourceBundle(loadResourceBundle(bundleName));
} catch (MissingResourceException e) {
// ignore
}
record.setResourceBundleName(bundleName);
}
record.setLoggerName(this.name);
record.setSourceClassName(sourceClass);
record.setSourceMethodName(sourceMethod);
record.setThrown(thrown);
log(record);
}
|
final void | removeChild(java.util.logging.Logger child)
childs.remove(child);
|
public void | removeHandler(java.util.logging.Handler handler)Removes a handler from this logger. If the specified handler does not
exist then this method has no effect.
// Anonymous loggers can always remove handlers
if (this.isNamed) {
LogManager.getLogManager().checkAccess();
}
if (null == handler) {
return;
}
initHandler();
synchronized(this){
this.handlers.remove(handler);
}
|
synchronized void | reset()
levelObjVal = null;
levelIntVal = Level.INFO.intValue();
if(handlers != null){
for (Handler element : handlers) {
// close all handlers, when unknown exceptions happen,
// ignore them and go on
try {
element.close();
} catch (Exception e) {
// Ignored.
}
}
handlers.clear();
}
handlerInited = false;
|
public void | setFilter(java.util.logging.Filter newFilter)Sets the filter used by this logger.
// Anonymous loggers can always set the filter
if (this.isNamed) {
LogManager.getLogManager().checkAccess();
}
filter = newFilter;
|
public void | setLevel(java.util.logging.Level newLevel)Sets the logging level for this logger. A {@code null} level indicates
that this logger will inherit its parent's level.
// Anonymous loggers can always set the level
if (this.isNamed) {
LogManager.getLogManager().checkAccess();
}
synchronized (LogManager.getLogManager()) {
setLevelImpl(newLevel);
}
|
private void | setLevelImpl(java.util.logging.Level newLevel)
// update levels for the whole hierarchy
int oldVal = levelIntVal;
levelObjVal = newLevel;
if (null == newLevel) {
levelIntVal = null != parent
? parent.levelIntVal
: Level.INFO.intValue();
} else {
levelIntVal = newLevel.intValue();
}
if (oldVal != levelIntVal) {
forceChildsToInherit();
}
|
void | setManager(java.util.logging.LogManager manager)
if(this.manager != manager){
this.manager = manager;
handlerInited = false;
}
//init level here, but let handlers be for lazy loading
String configedLevel = manager.getProperty(name+ ".level"); //$NON-NLS-1$
if (null != configedLevel) {
try {
setLevel(Level.parse(configedLevel));
} catch (IllegalArgumentException e) {
//ignore
}
}
|
public void | setParent(java.util.logging.Logger parent)Sets the parent of this logger in the namespace. This method should be
used by the {@code LogManager} object only.
if (null == parent) {
// logging.B=The 'parent' parameter is null.
throw new NullPointerException(Messages.getString("logging.B")); //$NON-NLS-1$
}
// even anonymous loggers are checked
LogManager.getLogManager().checkAccess();
internalSetParent(parent);
|
private void | setResourceBundle(java.util.logging.LogRecord record)
if (null != this.resBundleName) {
record.setResourceBundle(this.resBundle);
record.setResourceBundleName(this.resBundleName);
} else {
Logger anyParent = this.parent;
// no need to synchronize here, because if resBundleName
// is not null, there is no chance to modify it
while (null != anyParent) {
if (null != anyParent.resBundleName) {
record.setResourceBundle(anyParent.resBundle);
record.setResourceBundleName(anyParent.resBundleName);
return;
}
anyParent = anyParent.parent;
}
}
|
public void | setUseParentHandlers(boolean notifyParentHandlers)Sets the flag which indicates whether to use the handlers of this
logger's parent, potentially recursively up the namespace.
// Anonymous loggers can always set the useParentHandlers flag
if (this.isNamed) {
LogManager.getLogManager().checkAccess();
}
this.notifyParentHandlers = notifyParentHandlers;
|
public void | severe(java.lang.String msg)Logs a message of level {@code Level.SEVERE}; the message is transmitted
to all subscribed handlers.
if (internalIsLoggable(Level.SEVERE)) {
LogRecord record = new LogRecord(Level.SEVERE, msg);
record.setLoggerName(this.name);
setResourceBundle(record);
log(record);
}
|
public void | throwing(java.lang.String sourceClass, java.lang.String sourceMethod, java.lang.Throwable thrown)Logs a message indicating that an exception is thrown. A log record with
log level {@code Level.FINER}, log message "THROW", the specified source
class name, source method name and the {@code Throwable} object is
submitted for logging.
if (internalIsLoggable(Level.FINER)) {
LogRecord record = new LogRecord(Level.FINER, "THROW"); //$NON-NLS-1$
record.setLoggerName(this.name);
record.setSourceClassName(sourceClass);
record.setSourceMethodName(sourceMethod);
record.setThrown(thrown);
setResourceBundle(record);
log(record);
}
|
private static void | updateResourceBundle(java.util.logging.Logger l, java.lang.String resourceBundleName)
synchronized (l) {
if (null == l.getResourceBundleName()) {
if(null == resourceBundleName){
return;
}
/*
* load the resource bundle if none is specified
* before
*/
l.resBundle = loadResourceBundle(resourceBundleName);
l.resBundleName = resourceBundleName;
} else if (!l.getResourceBundleName().equals(resourceBundleName)) {
/*
* throw exception if the specified resource bundles
* are inconsistent with each other, i.e., different
* names
*/
// logging.9=The specified resource bundle name "{0}" is
// inconsistent with the existing one "{1}".
throw new IllegalArgumentException(Messages.getString(
"logging.9", //$NON-NLS-1$
resourceBundleName, l.getResourceBundleName()));
}
}
|
public void | warning(java.lang.String msg)Logs a message of level {@code Level.WARNING}; the message is
transmitted to all subscribed handlers.
if (internalIsLoggable(Level.WARNING)) {
LogRecord record = new LogRecord(Level.WARNING, msg);
record.setLoggerName(this.name);
setResourceBundle(record);
log(record);
}
|