Loggifier.unkrig.de / Tools / Command line tool

From unkrig.de
< Loggifier.unkrig.de (Difference between revisions)
Jump to: navigation, search
m
m
 
Line 1: Line 1:
Running the LOGGIFIER command line tool with the '&lt;code>-help&lt;/code>' option explains its usage:
+
Running the LOGGIFIER command line tool with the '<code>-help</code>' option explains its usage:
  
 
   Implants logging code into Java class files, and also into class files in
 
   Implants logging code into Java class files, and also into class files in
Line 7: Line 7:
 
   Usage:
 
   Usage:
 
     java de.unkrig.loggifier.Main [ &lt;option> ] ... &lt;file-or-dir>
 
     java de.unkrig.loggifier.Main [ &lt;option> ] ... &lt;file-or-dir>
   Transforms the given &lt;file-or-dir> in-place.
+
   Transforms the given <file-or-dir> in-place.
     java de.unkrig.loggifier.Main [ &lt;option> ] ... &lt;file-or-dir> ... &lt;dir>
+
     java de.unkrig.loggifier.Main [ &lt;option> ] ... <file-or-dir> ... <dir>
   Transforms the given &lt;file-or-dir>s into files-and-dirs with the same names in &lt;dir>.
+
   Transforms the given <file-or-dir>s into files-and-dirs with the same names in &lt;dir>.
     java de.unkrig.loggifier.Main [ &lt;option> ] ... &lt;file-or-dir> &lt;file-or-new-dir>
+
     java de.unkrig.loggifier.Main [ &lt;option> ] ... <file-or-dir> &lt;file-or-new-dir>
   Transforms the given &lt;file-or-dir> into &lt;file-or-new-dir>.
+
   Transforms the given <file-or-dir> into <file-or-new-dir>.
 
    
 
    
 
   Valid options:
 
   Valid options:
 
     -help          Shows this text.
 
     -help          Shows this text.
 
     -keep          Keep copies of original files (iff transforming in-place).
 
     -keep          Keep copies of original files (iff transforming in-place).
     -selector &lt;glob>
+
     -selector <glob>
 
                     Loggify only classes matching the &lt;glob>.
 
                     Loggify only classes matching the &lt;glob>.
     -logging-system &lt;id>
+
     -logging-system <id>
 
                     Style of the logging code to inject.
 
                     Style of the logging code to inject.
                     &lt;id> is 'jre14', 'log4j', 'log4j2' or 'slf4j'
+
                     <id> is 'jre14', 'log4j', 'log4j2' or 'slf4j'. The default is
     -rule &lt;rule>    Add the given loggification rule (format see below).
+
                    to guess, based on the classes on the classpath.
 +
     -rule <rule>    Add the given loggification rule (format see below).
 
     -nowarn -quiet -verbose -debug
 
     -nowarn -quiet -verbose -debug
     -log &lt;level>:&lt;logger>:&lt;handler>:&lt;formatter>:&lt;format>
+
     -log <level>:<logger>:<handler>:<formatter>:<format>
 
                     Configure the log output of this command line tool.
 
                     Configure the log output of this command line tool.
 
   
 
   
 
   The loggification rule format is as follows:
 
   The loggification rule format is as follows:
     &lt;action>[,&lt;action>]...=&lt;level>[:&lt;expression>]
+
     <action>[,<action>]...=<level>[:<expression>]
 
    
 
    
   &lt;action>:    One of [ALOAD, ARITH, ASTORE, CAST, CATCH, CLINIT, CONST,
+
   <action>:    One of [ALOAD, ARITH, ASTORE, CAST, CATCH, CLINIT, CONST,
 
                 CONVERT, ENTRY, GET, INVOKE, INSTANCEOF, LENGTH,
 
                 CONVERT, ENTRY, GET, INVOKE, INSTANCEOF, LENGTH,
 
                 LOAD, NEW, PUT, RESULT, RETURN, STORE, SWITCH, THROW].
 
                 LOAD, NEW, PUT, RESULT, RETURN, STORE, SWITCH, THROW].
   &lt;level>:      One of [OFF SEVERE WARNING INFO CONFIG FINE FINER FINEST].
+
   <level>:      One of [OFF SEVERE WARNING INFO CONFIG FINE FINER FINEST].
   &lt;expression>: E.g. '(&lt;eq> || &lt;eq>) && !&lt;eq>', where
+
   <expression>: E.g. '(<eq> || <eq>) && !<eq>', where
   &lt;eq>:        '&lt;var> == &lt;glob>', where
+
   <eq>:        '&lt;var> == <glob>', where
 
   &lt;var>:        is one of [action source classAccess class methodAccess method
 
   &lt;var>:        is one of [action source classAccess class methodAccess method
 
                 line type classAndField variable].
 
                 line type classAndField variable].
Line 40: Line 41:
 
                 For actions [GET PUT] also 'classAndField'.
 
                 For actions [GET PUT] also 'classAndField'.
 
                 For actions [LOAD STORE] also 'name'.
 
                 For actions [LOAD STORE] also 'name'.
   &lt;glob>:      is a 'glob pattern' in single quotes like '*main*'.
+
   <glob>:      is a 'glob pattern' in single quotes like '*main*'.
 
    
 
    
 
   The exit status is 1 iff errors occurred during loggification.
 
   The exit status is 1 iff errors occurred during loggification.

Latest revision as of 21:50, 1 September 2014

Running the LOGGIFIER command line tool with the '-help' option explains its usage:

 Implants logging code into Java class files, and also into class files in
 directory trees, ZIP format files (.zip, .jar, .war, .ear, ...) and nested ZIP
 format files (e.g. .war in .ear).
 
 Usage:
   java de.unkrig.loggifier.Main [ <option> ] ... <file-or-dir>
 Transforms the given <file-or-dir> in-place.
   java de.unkrig.loggifier.Main [ <option> ] ... <file-or-dir> ... <dir>
 Transforms the given <file-or-dir>s into files-and-dirs with the same names in <dir>.
   java de.unkrig.loggifier.Main [ <option> ] ... <file-or-dir> <file-or-new-dir>
 Transforms the given <file-or-dir> into <file-or-new-dir>.
 
 Valid options:
   -help           Shows this text.
   -keep           Keep copies of original files (iff transforming in-place).
   -selector <glob>
                   Loggify only classes matching the <glob>.
   -logging-system <id>
                   Style of the logging code to inject.
                   <id> is 'jre14', 'log4j', 'log4j2' or 'slf4j'. The default is
                   to guess, based on the classes on the classpath.
   -rule <rule>    Add the given loggification rule (format see below).
   -nowarn -quiet -verbose -debug
   -log <level>:<logger>:<handler>:<formatter>:<format>
                   Configure the log output of this command line tool.

 The loggification rule format is as follows:
   <action>[,<action>]...=<level>[:<expression>]
 
 <action>:     One of [ALOAD, ARITH, ASTORE, CAST, CATCH, CLINIT, CONST,
               CONVERT, ENTRY, GET, INVOKE, INSTANCEOF, LENGTH,
               LOAD, NEW, PUT, RESULT, RETURN, STORE, SWITCH, THROW].
 <level>:      One of [OFF SEVERE WARNING INFO CONFIG FINE FINER FINEST].
 <expression>: E.g. '(<eq> || <eq>) && !<eq>', where
 <eq>:         '<var> == <glob>', where
 <var>:        is one of [action source classAccess class methodAccess method
               line type classAndField variable].
               For actions [CAST INSTANCEOF NEW] also 'type'.
               For actions [GET PUT] also 'classAndField'.
               For actions [LOAD STORE] also 'name'.
 <glob>:       is a 'glob pattern' in single quotes like '*main*'.
 
 The exit status is 1 iff errors occurred during loggification.
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox