/** * Sets the format for displaying the source, or hides the source field. * The given format can be any of the following values, from more verbose to less verbose: * * <ul> * <li>{@code null} for hiding the source field.</li> * <li>{@code "class:long"} for the {@linkplain LogRecord#getSourceClassName() source class name}</li> * <li>{@code "logger:long"} for the {@linkplain LogRecord#getLoggerName() logger name}</li> * <li>{@code "class:short"} for the source class name without the package part.</li> * <li>{@code "logger:short"} for the logger name without the package part.</li> * <li>{@code "class.method"} for the short class name followed by the * {@linkplain LogRecord#getSourceMethodName() source method name}</li> * </ul> * * The source class name usually contains the logger name since (by convention) logger * names are package names, but this is not mandatory neither enforced. * * @param format the format for displaying the source, or {@code null} if the source shall not be formatted. * @throws IllegalArgumentException if the given argument is not one of the recognized format names. */ public void setSourceFormat(final String format) throws IllegalArgumentException { synchronized (buffer) { sourceFormat(format); } }
/** * Sets the format for displaying the source, or hides the source field. * The given format can be any of the following values, from more verbose to less verbose: * * <ul> * <li>{@code null} for hiding the source field.</li> * <li>{@code "class:long"} for the {@linkplain LogRecord#getSourceClassName() source class name}</li> * <li>{@code "logger:long"} for the {@linkplain LogRecord#getLoggerName() logger name}</li> * <li>{@code "class:short"} for the source class name without the package part.</li> * <li>{@code "logger:short"} for the logger name without the package part.</li> * <li>{@code "class.method"} for the short class name followed by the * {@linkplain LogRecord#getSourceMethodName() source method name}</li> * </ul> * * The source class name usually contains the logger name since (by convention) logger * names are package names, but this is not mandatory neither enforced. * * @param format the format for displaying the source, or {@code null} if the source shall not be formatted. * @throws IllegalArgumentException if the given argument is not one of the recognized format names. */ public void setSourceFormat(final String format) throws IllegalArgumentException { synchronized (buffer) { sourceFormat(format); } }
sourceFormat(manager.getProperty(classname + ".source")); } catch (IllegalArgumentException exception) { Logging.configurationException(Logging.getLogger(Modules.UTILITIES), MonolineFormatter.class, "<init>", exception);
sourceFormat(manager.getProperty(classname + ".source")); } catch (IllegalArgumentException exception) { Logging.configurationException(Logging.getLogger(Modules.UTILITIES), MonolineFormatter.class, "<init>", exception);