Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-2326

Please consider to provide shortcuts for most common methods of Logger.

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: API
    • Labels:
      None

      Description

      Hey guys,

      I'm using Log4j a lot in my project, it even becomes a little bit too verbose to type error info etc... I wonder whether if it's radical to add some shortcuts for these methods?

      For example:
      t = trace
      d = debug
      i = info
      w = warn
      e = error
      f = fatal

       public class Demo {
           public void main(String[] args) {
               L.d("args: {}", Arrays.toString(args));
      
               int x = 1 + 2;
               L.i("final result: {}", x);
      
              if(x > 3) {
                   L.e("unexpected result: {}", x); 
              }
      
              L.f("exit.");
           }
       }
      

      for example's sake, debug, info, error and fatal are all employed in the code snippet, in reality, though it's not very likely, so the confused look of the these method should not be so scary.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              metrxqin@gmail.com Jerry Chin
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: