The precision specifiers in the PatternLayout for category (%c) and calling class (%C) take a single integer which specifies that only that number of the right most components will be printed. I want to be able to print only the 4th component counting from the left.
I propose a change to the pattern specifier as follows:
x : a single positive int, has the same meaning as now (the xth components counting from
the right)
-x : negative integer, means the xth components counting from the left
x,y : a pair of ints, means those components between the xth and yth postions counting from the right or left depending on their sign
So my desired output could then be specified as %c{-4,-4}
Before I implement this, I'd like to know if people think this is wacko or have a better approach.
Thanks,
James