summaryrefslogtreecommitdiffstats
path: root/logserver/src/main/java/com/yahoo/logserver/formatter/LogFormatter.java
blob: ef42a915e2472c6a665aebba820319003203396b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.logserver.formatter;

import com.yahoo.log.LogMessage;

/**
 * This interface is analogous to the java.util.logging.Formatter
 * interface.  Classes implementing this interface should be
 * <b>stateless/immutable if possible so formatters can be
 * shared</b>.  If it does have state it must not prevent
 * concurrent use.
 *
 * @author Bjorn Borud
 */
public interface LogFormatter {
    /**
     * Format log message as a string.
     *
     * @param msg The log message
     */
    String format(LogMessage msg);

    /**
     * Returns a textual description of the formatter
     */
    String description();
}