Topic: 我写的一个日志包 |
Print this page |
1.我写的一个日志包 | Copy to clipboard |
Posted by: wes109 Posted on: 2003-10-16 17:37 他们说不好 大家给提提意见 log.zip (7.22k) |
2.Re:我写的一个日志包 [Re: wes109] | Copy to clipboard |
Posted by: wes109 Posted on: 2003-10-16 18:44 差就差了 大伙好歹给个评论 |
3.Re:我写的一个日志包 [Re: wes109] | Copy to clipboard |
Posted by: ajinjin Posted on: 2003-10-16 18:45 正要参考下 |
4.Re:我写的一个日志包 [Re: wes109] | Copy to clipboard |
Posted by: helloworld Posted on: 2003-10-16 18:50 支持一下,看一下. |
5.Re:我写的一个日志包 [Re: wes109] | Copy to clipboard |
Posted by: jameszhang Posted on: 2003-10-16 18:55 需要时间呀 |
6.Re:我写的一个日志包 [Re: jameszhang] | Copy to clipboard |
Posted by: wes109 Posted on: 2003-10-16 21:10 jameszhang wrote: 老大,给点指导 这是我考虑了几个晚上做出来的 因为学了一点模式,就用了command,observer,factory,singleton 1.可以动态添加新的Logger,如FileLogger,只要extends AbstractLogger实现相应方法就可以了 2.为了不让使用者改变SystemLogger的list,所以observer有点bt 现在需要您批评,指点!!!! (放出来不是为了哗众取宠的,是为了发现和提高自己的,盼各位GG指点一二,不胜感激涕零) |
7.Re:我写的一个日志包 [Re: wes109] | Copy to clipboard |
Posted by: jfml Posted on: 2003-10-17 09:04 支持 一直想自己写一个 但就是没时间 总是在用Log4j |
8.Re:我写的一个日志包 [Re: CrazyJavar] | Copy to clipboard |
Posted by: collins Posted on: 2003-10-17 10:00 请说说写这个的必要,logging framework多的是,且个个强大、稳定。 |
9.Re:我写的一个日志包 [Re: wes109] | Copy to clipboard |
Posted by: jfml Posted on: 2003-10-17 10:03 学习的意义比使用的意义大 支持楼主 |
10.Re:我写的一个日志包 [Re: wes109] | Copy to clipboard |
Posted by: jameszhang Posted on: 2003-10-17 10:17 写的非常好,正在学习。。。。 问题: 为什么要加个class DBLogger,其中的saveDB好象有点把这个包限制死了,只能调用你数据包,而且表名也限定了......... |
11.Re:我写的一个日志包 [Re: collins] | Copy to clipboard |
Posted by: mosaic Posted on: 2003-10-17 10:35 collins wrote: 能不能列举两三个? |
12.Re:我写的一个日志包 [Re: jameszhang] | Copy to clipboard |
Posted by: wes109 Posted on: 2003-10-17 11:00 jameszhang wrote: 那个DBLogge的saveToDB完全可以是空的(会更好一些)或abstract 实现只是为了迎合。。。。(牢骚先不发) saveToDB是protected,可以在子类中override com.yingnet.shareclub.ShareClubDBLogger 就是这么做的 这个日志包总体功能还是很弱的 只是为了满足现在一个小项目的需要 和log4j等没有可比性 最近看Agile Software Develope 感觉获益匪浅,强烈推荐! |
13.Re:我写的一个日志包 [Re: wes109] | Copy to clipboard |
Posted by: jameszhang Posted on: 2003-10-17 12:00 Agile Software Develope 在那里我也学学呀? |
14.Re:我写的一个日志包 [Re: wes109] | Copy to clipboard |
Posted by: wes109 Posted on: 2003-10-17 12:07 我买的书 :) 《敏捷软件开发》,Uncle Bob的作品 到书城去找吧, 绝对对得起你的每一个银子 |
15.Re:我写的一个日志包 [Re: wes109] | Copy to clipboard |
Posted by: jameszhang Posted on: 2003-10-17 14:21 wes109 wrote: 看见过,当时没太注意,一定去看看,谢谢 |
16.Re:我写的一个日志包 [Re: wes109] | Copy to clipboard |
Posted by: floater Posted on: 2003-10-17 23:03 Since there are other files that you didn't include, I can't use UML diagrams(they can't be compiled with those files). However, the dependencies are kind of odd. In general, the classes and packages should be built in the direction of stability, non related classes should be in the seperate packages. Keep the core log classes in one package, and keep the db related classes in a seperate package. So you have log core at the bottom, db classes in the middle off the center line, and log db package at the top, and depends on db and core log. In general, the log level should be linear, not independent, such that if I have this: debug - info - warning - error if I turn on warning, it will show both warning and error; if I turn on debug, it will print out everything. Even more general, a logging tool should have two thing, levels and channels(files in most cases). log4j is the best java log tools, but it doesn't have the capability to turn on/off channels on components(only on the entire system). |
17.Re:我写的一个日志包 [Re: wes109] | Copy to clipboard |
Posted by: floater Posted on: 2003-10-18 00:46 well, I suddenly realized that by putting a log4j.properties under class dir, we can turn on/off component logging too. |
18.Re:我写的一个日志包 [Re: wes109] | Copy to clipboard |
Posted by: wes109 Posted on: 2003-10-18 22:39 虽看不太懂老大的e文,但基本了解老大的意思 如果可能我会在新版本中改进之 |
19.Re:我写的一个日志包 [Re: wes109] | Copy to clipboard |
Posted by: hitaco Posted on: 2003-10-20 20:31 自己写着玩不错,不过是用在project里而写的,那就变态了 |
20.Re:我写的一个日志包 [Re: hitaco] | Copy to clipboard |
Posted by: wes109 Posted on: 2003-10-21 08:39 hitaco wrote: 怎讲? 我们一直在用呀 开发阶段主要用来做调试,在控制台打印信息 准备在启用后把数据库日志开启 记录系统重要事件等 还请大虾指点一二 |
21.Re:我写的一个日志包 [Re: wes109] | Copy to clipboard |
Posted by: mefaint Posted on: 2003-10-21 10:00 自己用的话,个人认为log4j加以扩展足够,而且效果好的多。 有些模式好像用的比较勉强,数据的封装欠妥当。 有时间重构一下,重新划分一些数据与方法所在的类,逻辑关系会更清楚 |
22.Re:我写的一个日志包 [Re: wes109] | Copy to clipboard |
Posted by: hitaco Posted on: 2003-10-21 20:09 呵呵,那么多open source的,看不出除了自己练手,有什么必要,如果用existing open source的logging api, 通常能减少其他developer熟悉的时间。 wes109 wrote: |
23.Re:我写的一个日志包 [Re: wes109] | Copy to clipboard |
Posted by: hitaco Posted on: 2003-10-21 20:11 为什么不在log4j下自定义appender,或者用其现成的console appender,jdbc appender,我想,对于大多的project,已经足够了 wes109 wrote: |
24.Re:我写的一个日志包 [Re: wes109] | Copy to clipboard |
Posted by: floater Posted on: 2003-10-21 22:12 1. If you are selling your product, not sure whether you can bundle log4j, so don't tie your product to log4j. 2. It would be better, on the other hand, to give cumstoer the option to use log4j. So make your logging component as an interface to shield out this switch. |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |