From: Kevin G. <ke...@go...> - 2002-08-30 23:26:54
|
> 1) To an extent, the cat's out of the bag. Log4j makes the (constant) > integer representations of the above public, which means it's a BIG DEAL > (tm) to change ERROR => 3 to say ERROR => 1, and has a toLevel() method > which takes an int. We've done the same with Log4perl. The whole point of exporting constants is that if the users always use your exported constants, you can export different ones tomorrow and they're never the wiser. If they start using their own ints then it's their funeral. That's why you say flock(FH, LOCK_EX); instead of just flock(FH, 7) or whatever the actual value might be today on your platform. > lets us play fast & loose with numbers, we could just create something > like "MOREINFO" with a value of 6.5 and $logger->log(6.5, "You want it, > you got it") would work. Yeah, but it's no fun unless $logger->moreinfo(..) works! Erik W. Selberg wrote: > Kevin Goess wrote: > >> We should also keep the details of the level constants private. Someday >> I'd like to allow users to create their own levels (log4j does it with >> subclassing), so it would help to keep as many of the details hidden >> (therefore changeable) as possible, the user shouldn't count on anything >> more detailed than DEBUG < INFO < WARN < ERROR < FATAL. >> >> > So, thinking some more on this... > > 1) To an extent, the cat's out of the bag. Log4j makes the (constant) > integer representations of the above public, which means it's a BIG DEAL > (tm) to change ERROR => 3 to say ERROR => 1, and has a toLevel() method > which takes an int. We've done the same with Log4perl. So I'm not > convinced we need to move towards hiding the fact that levels are just > ints, and just give people a total order on a quasi-enumerated type. > > 2) It seems that it'd be super straightforward to add some code to > Level.pm to enable the insertion of a Level whereever --- and since Perl > lets us play fast & loose with numbers, we could just create something > like "MOREINFO" with a value of 6.5 and $logger->log(6.5, "You want it, > you got it") would work. Although I'm pretty sure that this would have > to be done within a Perl program --- not clear if an external config > would work though. > > Thoughts? > -e > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > log4perl-devel mailing list > log...@li... > https://lists.sourceforge.net/lists/listinfo/log4perl-devel -- Happy Trails . . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510) 525-5217 |