Advertisement
mnaufaldillah

Logger Jmeter

Oct 23rd, 2021
640
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 8.00 KB | None | 0 0
  1. /*
  2.  * Licensed to the Apache Software Foundation (ASF) under one or more
  3.  * contributor license agreements.  See the NOTICE file distributed with
  4.  * this work for additional information regarding copyright ownership.
  5.  * The ASF licenses this file to you under the Apache License, Version 2.0
  6.  * (the "License"); you may not use this file except in compliance with
  7.  * the License.  You may obtain a copy of the License at
  8.  *
  9.  * http://www.apache.org/licenses/LICENSE-2.0
  10.  *
  11.  * Unless required by applicable law or agreed to in writing, software
  12.  * distributed under the License is distributed on an "AS IS" BASIS,
  13.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.  * See the License for the specific language governing permissions and
  15.  * limitations under the License.
  16.  */
  17.  
  18. package org.apache.log;
  19.  
  20. /**
  21.  * The object interacted with by client objects to perform logging.
  22.  *
  23.  * @author <a href="mailto:dev@avalon.apache.org">Avalon Development Team</a>
  24.  * @author Peter Donald
  25.  * @deprecated Will be dropped in 3.3
  26.  */
  27. @Deprecated
  28. public abstract class Logger
  29. {
  30.     private static final Logger[] EMPTY_SET = new Logger[ 0 ];
  31.  
  32.     /**
  33.      * Separator character use to separate different categories
  34.      * @deprecated Will be dropped in 3.3
  35.      */
  36.     @Deprecated
  37.     public static final char CATEGORY_SEPARATOR = '.';
  38.  
  39.     /**
  40.      * Determine if messages of priority DEBUG will be logged.
  41.      *
  42.      * @return true if DEBUG messages will be logged
  43.      */
  44.     public abstract boolean isDebugEnabled();
  45.  
  46.     /**
  47.      * Log a debug priority event.
  48.      *
  49.      * @param message the message
  50.      * @param throwable the throwable
  51.      */
  52.     public abstract void debug( final String message, final Throwable throwable );
  53.  
  54.     /**
  55.      * Log a debug priority event.
  56.      *
  57.      * @param message the message
  58.      */
  59.     public abstract void debug( final String message );
  60.  
  61.     /**
  62.      * Determine if messages of priority INFO will be logged.
  63.      *
  64.      * @return true if INFO messages will be logged
  65.      */
  66.     public abstract boolean isInfoEnabled();
  67.  
  68.     /**
  69.      * Log a info priority event.
  70.      *
  71.      * @param message the message
  72.      * @param throwable the throwable
  73.      */
  74.     public abstract void info( final String message, final Throwable throwable );
  75.  
  76.     /**
  77.      * Log a info priority event.
  78.      *
  79.      * @param message the message
  80.      */
  81.     public abstract void info( final String message );
  82.  
  83.     /**
  84.      * Determine if messages of priority WARN will be logged.
  85.      *
  86.      * @return true if WARN messages will be logged
  87.      */
  88.     public abstract boolean isWarnEnabled();
  89.  
  90.     /**
  91.      * Log a warn priority event.
  92.      *
  93.      * @param message the message
  94.      * @param throwable the throwable
  95.      */
  96.     public abstract void warn( final String message, final Throwable throwable );
  97.  
  98.     /**
  99.      * Log a warn priority event.
  100.      *
  101.      * @param message the message
  102.      */
  103.     public abstract void warn( final String message );
  104.  
  105.     /**
  106.      * Determine if messages of priority ERROR will be logged.
  107.      *
  108.      * @return true if ERROR messages will be logged
  109.      */
  110.     public abstract boolean isErrorEnabled();
  111.  
  112.     /**
  113.      * Log a error priority event.
  114.      *
  115.      * @param message the message
  116.      * @param throwable the throwable
  117.      */
  118.     public abstract void error( final String message, final Throwable throwable );
  119.  
  120.     /**
  121.      * Log a error priority event.
  122.      *
  123.      * @param message the message
  124.      */
  125.     public abstract void error( final String message );
  126.  
  127.     /**
  128.      * Determine if messages of priority FATAL_ERROR will be logged.
  129.      *
  130.      * @return true if FATAL_ERROR messages will be logged
  131.      */
  132.     public abstract boolean isFatalErrorEnabled();
  133.  
  134.     /**
  135.      * Log a fatalError priority event.
  136.      *
  137.      * @param message the message
  138.      * @param throwable the throwable
  139.      */
  140.     public abstract void fatalError( final String message, final Throwable throwable );
  141.  
  142.     /**
  143.      * Log a fatalError priority event.
  144.      *
  145.      * @param message the message
  146.      */
  147.     public abstract void fatalError( final String message );
  148.  
  149.     /**
  150.      * Make this logger additive. I.e. Send all log events to parent
  151.      * loggers LogTargets regardless of whether or not the
  152.      * LogTargets have been overridden.
  153.      *
  154.      * This is derived from Log4js notion of Additivity.
  155.      *
  156.      * @param additivity true to make logger additive, false otherwise
  157.      * @deprecated Will be dropped in 3.3
  158.      */
  159.     @Deprecated
  160.     public void setAdditivity( final boolean additivity )
  161.     {
  162.         // NOP
  163.     }
  164.  
  165.     /**
  166.      * Determine if messages of priority will be logged.
  167.      * @param priority the priority
  168.      * @return true if messages will be logged
  169.      */
  170.     public abstract boolean isPriorityEnabled( final Priority priority );
  171.  
  172.     /**
  173.      * Log a event at specific priority with a certain message and throwable.
  174.      *
  175.      * @param priority the priority
  176.      * @param message the message
  177.      * @param throwable the throwable
  178.      */
  179.     public abstract void log( final Priority priority,
  180.                      final String message,
  181.                      final Throwable throwable );
  182.  
  183.     /**
  184.      * Log a event at specific priority with a certain message.
  185.      *
  186.      * @param priority the priority
  187.      * @param message the message
  188.      */
  189.     public abstract void log( final Priority priority, final String message );
  190.  
  191.     /**
  192.      * Set the priority for this logger.
  193.      *
  194.      * @param priority the priority
  195.      * @deprecated Will be dropped in 3.3
  196.      */
  197.     @Deprecated
  198.     public void setPriority( final Priority priority )
  199.     {
  200.         // NOP
  201.     }
  202.  
  203.     /**
  204.      * Unset the priority of Logger.
  205.      * (Thus it will use it's parent's priority or DEBUG if no parent.
  206.      * @deprecated Will be dropped in 3.3
  207.      */
  208.     @Deprecated
  209.     public void unsetPriority()
  210.     {
  211.         // NOP
  212.     }
  213.  
  214.     /**
  215.      * Unset the priority of Logger.
  216.      * (Thus it will use it's parent's priority or DEBUG if no parent.
  217.      * If recursive is true unset priorities of all child loggers.
  218.      *
  219.      * @param recursive true to unset priority of all child loggers
  220.      * @deprecated Will be dropped in 3.3
  221.      */
  222.     @Deprecated
  223.     public void unsetPriority( final boolean recursive )
  224.     {
  225.         // NOP
  226.     }
  227.  
  228.     /**
  229.      * Set the log targets for this logger.
  230.      *
  231.      * @param logTargets the Log Targets
  232.      * @deprecated Will be dropped in 3.3
  233.      */
  234.     @Deprecated
  235.     public void setLogTargets( final LogTarget[] logTargets )
  236.     {
  237.         // NOP
  238.     }
  239.  
  240.     /**
  241.      * Unset the logtargets for this logger.
  242.      * This logger (and thus all child loggers who don't specify logtargets) will
  243.      * inherit from the parents LogTargets.
  244.      * @deprecated Will be dropped in 3.3
  245.      */
  246.     @Deprecated
  247.     public void unsetLogTargets()
  248.     {
  249.         // NOP
  250.     }
  251.  
  252.     /**
  253.      * Unset the logtargets for this logger and all child loggers if recursive is set.
  254.      * The loggers unset (and all child loggers who don't specify logtargets) will
  255.      * inherit from the parents LogTargets.
  256.      * @param recursive the recursion policy
  257.      * @deprecated Will be dropped in 3.3
  258.      */
  259.     @Deprecated
  260.     public void unsetLogTargets( final boolean recursive )
  261.     {
  262.         // NOP
  263.     }
  264.  
  265.     /**
  266.      * Get all the child Loggers of current logger.
  267.      *
  268.      * @return the child loggers
  269.      * @deprecated Will be dropped in 3.3
  270.      */
  271.     @Deprecated
  272.     public Logger[] getChildren()
  273.     {
  274.         // NOP
  275.         return EMPTY_SET;
  276.     }
  277.  
  278.     /**
  279.      * Create a new child logger.
  280.      * The category of child logger is [current-category].subcategory
  281.      *
  282.      * @param subCategory the subcategory of this logger
  283.      * @return the new logger
  284.      * @exception IllegalArgumentException if subCategory has an empty element name
  285.      */
  286.     public abstract Logger getChildLogger( final String subCategory );
  287. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement