From: Erik W. S. <er...@se...> - 2002-08-31 07:04:24
|
> > > So here's what would make me happy, which is similar. :) > > > > inc_level($levels) > > dec_level($levels) > > Ja, way better! > > > we assume we're starting off at Level 0 (OFF / FATAL :), > > $log->inc_level(3) puts us up three levels. If those levels happen to be > > ERROR, WARN, and INFO, then we're at INFO. If some user decides they > > need CRITICAL and ALERT (say legacy syslog support) and put them in, > > then inc_level(3) just get's 'em to ERROR. Make sense? > > Yeah, but the other way. All the log4j docs say FATAL is *high* and > DEBUG is *low*, (DEBUG < INFO < WARN < ERROR < FATAL) so from INFO > $log->inc_level(2) would give you ERROR. When adding -v to increase > the *verbosity* you'd want to decrease the log level towards DEBUG. > Does that sound right? Let's solve the problem with naming: more_logging($levels) less_logging($levels) So, a user never cares whether more_logging(3) sets the constant from MAXINT to 30,000 or from 0 to 3, just that we're getting getting three more levels of verbosity than we have right now. I'd also recommend we have something ALA syslog for all us soon-to-be ex-syslog(3) users: $log->syslog_level($SYSLOG_LEVEL) which does the appropriate mapping, and maps things like NOTIFY to WARN, as NOTIFY doesn't exist in log4perl land. And, I'd even say we should push these back to the log4j guys, as they seem pretty useful to me. :) -e |