From: Erik W. S. <er...@se...> - 2002-08-30 03:25:53
|
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 |