这个压缩包里的都是超级经典的java例子
源代码在线查看: islog.htm
Determining If a Message Will Be Logged (Java Developers Almanac Example)
The Java Developers Almanac 1.4
Order this book from Amazon.
google_ad_client = "pub-6001183370374757";
google_ad_width = 120;
google_ad_height = 600;
google_ad_format = "120x600_as";
google_ad_channel = "4777242811";
google_ad_type = "text_image";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "6666CC";
google_color_url = "6666CC";
google_color_text = "000000";
//-->
Home
>
List of Packages
>
java.util.logging
[20 examples]
e386. Determining If a Message Will Be Logged
See also e389 Minimizing the Impact of Logging Code.
Logger logger = Logger.getLogger("com.mycompany.MyClass");
// Check if the message will be logged
if (logger.isLoggable(Level.FINEST)) {
logger.finest("my finest message");
}
Related Examples
e385.
The Quintessential Logging Program
e387.
Logging a Method Call
e388.
Logging an Exception
e389.
Minimizing the Impact of Logging Code
e390.
Preventing a Logger from Forwarding Log Records to Its Parent
e391.
Writing Log Records to a Log File
e392.
Writing Log Records to Standard Error
e393.
Writing Log Records Only After a Condition Occurs
e394.
Setting a Filter on a Logger Handler
See also:
Configuration
File Size
Formatters
Levels
© 2002 Addison-Wesley.