Last active
May 20, 2017 12:36
-
-
Save solaris33/a070b41a1f7a5564c235e2e3ed4fd403 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Log a LogRecord. | |
* <p> | |
* All the other logging methods in this class call through | |
* this method to actually perform any logging. Subclasses can | |
* override this single method to capture all log activity. | |
* | |
* @param record the LogRecord to be published | |
*/ | |
public void log(LogRecord record) { | |
if (!isLoggable(record.getLevel())) { | |
return; | |
} | |
Filter theFilter = filter; | |
if (theFilter != null && !theFilter.isLoggable(record)) { | |
return; | |
} | |
// Post the LogRecord to all our Handlers, and then to | |
// our parents' handlers, all the way up the tree. | |
Logger logger = this; | |
while (logger != null) { | |
final Handler[] loggerHandlers = isSystemLogger | |
? logger.accessCheckedHandlers() | |
: logger.getHandlers(); | |
for (Handler handler : loggerHandlers) { | |
handler.publish(record); | |
} | |
final boolean useParentHdls = isSystemLogger | |
? logger.useParentHandlers | |
: logger.getUseParentHandlers(); | |
if (!useParentHdls) { | |
break; | |
} | |
logger = isSystemLogger ? logger.parent : logger.getParent(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment