1/*
2 * Copyright (C) 2009 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package dalvik.system;
18
19import java.util.logging.Level;
20import java.util.logging.Logger;
21
22/**
23 * An optimized handler for efficient publishing of basic log messages.
24 * Implementers should also be subclasses of {@link java.util.logging.Handler}.
25 *
26 * <p>Unlike the default log handler, this API doesn't require intermediate
27 * objects to be allocated for log handling. It also includes a short tag, which
28 * may otherwise need to be calculated for each published message.
29 *
30 * @hide
31 */
32public interface DalvikLogHandler {
33
34    /**
35     * Publishes a log message. Unlike {@link
36     * java.util.logging.Handler#publish(java.util.logging.LogRecord)}, this
37     * method includes only the raw log message. Log messages that were created
38     * with additional fields (parameters, source methods, etc.) will flow
39     * through the conventional channels instead.
40     *
41     * @param tag the short (23 characters or fewer) logger tag identifying
42     *      {@code logger}.
43     */
44    void publish(Logger source, String tag, Level level, String message);
45
46    // TODO: support messages with throwables?
47}