< prev index next >

src/share/vm/logging/logConfiguration.hpp

Print this page
rev 8933 : 8046148.01


   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 #ifndef SHARE_VM_LOGGING_LOGCONFIGURATION_HPP
  25 #define SHARE_VM_LOGGING_LOGCONFIGURATION_HPP

  26 #include "memory/allocation.hpp"
  27 #include "utilities/globalDefinitions.hpp"
  28 
  29 class LogOutput;
  30 class LogDecorators;
  31 class LogTagLevelExpression;
  32 
  33 // Global configuration of logging. Handles parsing and configuration of the logging framework,
  34 // and manages the list of configured log outputs. The actual tag and level configuration is
  35 // kept implicitly in the LogTagSets and their LogOutputLists. During configuration the tagsets
  36 // are iterated over and updated accordingly.
  37 class LogConfiguration : public AllStatic {
  38  private:
  39   static LogOutput**  _outputs;
  40   static size_t       _n_outputs;
  41 
  42   // Create a new output. Returns NULL if failed.
  43   static LogOutput* new_output(char* name, const char* options = NULL);
  44 
  45   // Add an output to the list of configured outputs. Returns the assigned index.


  69   // Disable all logging, equivalent to -Xlog:disable.
  70   static void disable_logging();
  71 
  72   // Parse command line configuration. Parameter 'opts' is the string immediately following the -Xlog: argument ("gc" for -Xlog:gc).
  73   static bool parse_command_line_arguments(const char* opts = "all");
  74 
  75   // Parse separated configuration arguments (from JCmd/MBean and command line).
  76   static bool parse_log_arguments(const char* outputstr,
  77                                   const char* what,
  78                                   const char* decoratorstr,
  79                                   const char* output_options,
  80                                   outputStream* errstream);
  81 
  82   // Prints log configuration to outputStream, used by JCmd/MBean.
  83   static void describe(outputStream* out);
  84 
  85   // Prints usage help for command line log configuration.
  86   static void print_command_line_help(FILE* out);
  87 };
  88 
  89 #endif


   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 #ifndef SHARE_VM_LOGGING_LOGCONFIGURATION_HPP
  25 #define SHARE_VM_LOGGING_LOGCONFIGURATION_HPP
  26 
  27 #include "memory/allocation.hpp"
  28 #include "utilities/globalDefinitions.hpp"
  29 
  30 class LogOutput;
  31 class LogDecorators;
  32 class LogTagLevelExpression;
  33 
  34 // Global configuration of logging. Handles parsing and configuration of the logging framework,
  35 // and manages the list of configured log outputs. The actual tag and level configuration is
  36 // kept implicitly in the LogTagSets and their LogOutputLists. During configuration the tagsets
  37 // are iterated over and updated accordingly.
  38 class LogConfiguration : public AllStatic {
  39  private:
  40   static LogOutput**  _outputs;
  41   static size_t       _n_outputs;
  42 
  43   // Create a new output. Returns NULL if failed.
  44   static LogOutput* new_output(char* name, const char* options = NULL);
  45 
  46   // Add an output to the list of configured outputs. Returns the assigned index.


  70   // Disable all logging, equivalent to -Xlog:disable.
  71   static void disable_logging();
  72 
  73   // Parse command line configuration. Parameter 'opts' is the string immediately following the -Xlog: argument ("gc" for -Xlog:gc).
  74   static bool parse_command_line_arguments(const char* opts = "all");
  75 
  76   // Parse separated configuration arguments (from JCmd/MBean and command line).
  77   static bool parse_log_arguments(const char* outputstr,
  78                                   const char* what,
  79                                   const char* decoratorstr,
  80                                   const char* output_options,
  81                                   outputStream* errstream);
  82 
  83   // Prints log configuration to outputStream, used by JCmd/MBean.
  84   static void describe(outputStream* out);
  85 
  86   // Prints usage help for command line log configuration.
  87   static void print_command_line_help(FILE* out);
  88 };
  89 
  90 #endif // SHARE_VM_LOGGING_LOGCONFIGURATION_HPP
< prev index next >