log4j笔记之Category

org.apache.log4j.Category

This class has been deprecated and replaced by the Logger subclass. It will be kept around to preserve backward compatibility until mid 2003.

这个类已经被废弃并且被Logger的子类代替。它将将保留为了保持向后兼容性,直到2003年中期。

 

Logger is a subclass of Category, it extends Category. In other words, a logger is a category. Thus, all operations that can be performed on a category can be performed on a logger. Whenever log4j is asked to produce a Category object, it will instead produce a Logger object. However, methods that previously accepted category objects still continue to accept category objects.

Logger是Category的子类,它继承了Category。换句话说,logger就是category。因此,所有的操作(能使用category完成的)都能用logger完成。无论什么时候,当需要使用log4j来创建一个Category对象,都可以产生一个Logger对象来替换。

For example, the following are all legal and will work as expected.

   // Deprecated form:
   Category cat = Category.getInstance("foo.bar")

   // Preferred form for retrieving loggers:
   Logger logger = Logger.getLogger("foo.bar")

The first form is deprecated and should be avoided.

第一种形式已经废弃,应该避免使用

 

There is absolutely no need for new client code to use or refer to the Category class. Whenever possible, please avoid referring to it or using it.

绝对没必要在新的代码中使用或者参照Category class。无论什么时候,如果可能的话,请避免使用或则参照Category Class

 

See the short manual for an introduction on this class. 看简短手册对Category Class的介绍

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值