You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by go...@tarsec.com on 2002/04/01 21:35:48 UTC

Feature request: short names for Level/Priority classes

Hi

I would like to see short names in the Level class (as I proposed already
earlier this year). A single character entry would do.

Here some code snippets to realize it:

...

public class Priority {

  int level;
  String levelStr;
  String shortLevelStr;

...

  /**
     Returns the short string representation of this priority.
   */
  final
  public
  String toShortString() {
    return shortLevelStr;
  }

...

---------------------

...

public class Level extends Priority {


  /**
     The <code>OFF</code> has the highest possible rank and is
     intended to turn off logging.  */
  final static public Level OFF = new Level(OFF_INT, "OFF", "O", 0);

...

  /**
     Instantiate a Level object.
   */
  protected
  Level(int level, String levelStr, String shortLevelString, int
syslogEquivalent) {
    super(level, levelStr, shortLevelString, syslogEquivalent);
  }

...

------------------------------------

regards

-Bernd.

-- 
Bernd Goetz                                     goetz@tarsec.com
TARSEC AG                                       Tel +41 1 496 61 11
Rautistrasse 12                                 Fax +41 1 496 61 99
Postfach                                        Mobile +41 79 759 04 26
8047 Zurich, Switzerland                        http://www.tarsec.com

Re: Feature request: short names for Level/Priority classes

Posted by Ceki Gülcü <ce...@qos.ch>.
Hi Bernd,

Custom conversion characters in PatternLayout are scheduled for log4j 1.3.
See http://jakarta.apache.org/log4j/docs/plan.html for the plan. I extracted
the relevant text for easy reference:

Custom conversion characters in PatternLayout:

Users often want to add new conversions characters or override the existing 
ones.
This should be made easy using new configuration directives. This feature 
would use
the extensions to XML configuration language mentioned above.

This hopefully answers your request.


At 21:35 01.04.2002 +0200, you wrote:
>Hi
>
>I would like to see short names in the Level class (as I proposed already
>earlier this year). A single character entry would do.
>
>Here some code snippets to realize it:
>
>...
>
>public class Priority {
>
>   int level;
>   String levelStr;
>   String shortLevelStr;
>
>...
>
>   /**
>      Returns the short string representation of this priority.
>    */
>   final
>   public
>   String toShortString() {
>     return shortLevelStr;
>   }
>
>...
>
>---------------------
>
>...
>
>public class Level extends Priority {
>
>
>   /**
>      The <code>OFF</code> has the highest possible rank and is
>      intended to turn off logging.  */
>   final static public Level OFF = new Level(OFF_INT, "OFF", "O", 0);
>
>...
>
>   /**
>      Instantiate a Level object.
>    */
>   protected
>   Level(int level, String levelStr, String shortLevelString, int
>syslogEquivalent) {
>     super(level, levelStr, shortLevelString, syslogEquivalent);
>   }
>
>...
>
>------------------------------------
>
>regards
>
>-Bernd.
>
>--
>Bernd Goetz                                     goetz@tarsec.com
>TARSEC AG                                       Tel +41 1 496 61 11
>Rautistrasse 12                                 Fax +41 1 496 61 99
>Postfach                                        Mobile +41 79 759 04 26
>8047 Zurich, Switzerland                        http://www.tarsec.com
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>

--
Ceki
My link of the month: 
http://www.suntimes.com/output/otherviews/cst-edt-ref31.html


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>