From: Erik W. S. <er...@se...> - 2002-08-31 06:42:12
|
A-HA! Now I think I get what they did. Not fully broken. Just standard Java code of far too much abstraction while embedding constants every now and then. :) The Priority Class has a built-in notion of syslog equivalent. This, Level.ERROR, which is a Level Class (and extends Priority), has an attribute of syslogEquivalent which in this case is 3. I didn't properly read the constructors, as I saw things like: final static public Priority ERROR = new Level(ERROR_INT, "ERROR", 3); and assumed that 3 was the constant they used, not ERROR_INT, which is 40,000. Their toLevel(int) also expects one of the integer constants, like ERROR_INT == 40000. So, I'd say we should: (a) adjust our constants to match, and (b) implement something like what I want so I can just inc up some levels and not care that WARN is 10,000 more than ERROR. -e Msc...@ao... wrote: > In a message dated 8/29/02 9:58:43 AM Pacific Daylight Time, > ke...@go... writes: > > >> If A. Programmer has turned logging OFF, Log4perl should spew no >> messages, including FATAL messages. > > > > Just rummaged through the log4j code and this is what I found: > > public final static int OFF_INT = Integer.MAX_VALUE; > public final static int FATAL_INT = 50000; > public final static int ERROR_INT = 40000; > public final static int WARN_INT = 30000; > public final static int INFO_INT = 20000; > public final static int DEBUG_INT = 10000; > //public final static int FINE_INT = DEBUG_INT; > public final static int ALL_INT = Integer.MIN_VALUE; > > So according to this, OFF will indeed turn off FATAL, which makes > sense. I took my mappings from the syslog equivalents (also defined in > log4j), which is probably wrong. We should be able to restructure the > integer values behind the scenes without breaking anything, so if you > guys are ok with it, I'm gonna take care of it. > > -- Mike > > Mike Schilli > log...@pe... > http://perlmeister.com > http://log4perl.sourceforge.net |