com.gh.bmd.jrt.log.Log Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jroutine Show documentation
Show all versions of jroutine Show documentation
Parallel programming on the go
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.gh.bmd.jrt.log;
import java.util.List;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
/**
* Interface defining a log object responsible for formatting and writing the framework log
* messages.
*
* A default global log instance can be set by invoking the proper logger methods. Note, however,
* that a routine instance cannot dynamically change its log after creation.
*
* Note also that a log instance is typically accessed from different threads, so, it is
* responsibility of the implementing class to avoid concurrency issues, by synchronizing mutable
* fields when needed.
*
* To avoid an excessive number of log messages it is sufficient to set an higher log level.
* Though, it is also possible to completely remove the log source code (and related strings) from
* the released code by using Proguard and adding, for example, the following rule to the
* configuration file:
*
*
*
* -assumenosideeffects class com.gh.bmd.jrt.log.Logger {
* public void dbg(...);
* }
*
*
*
* Created by davide on 10/3/14.
*
* @see com.gh.bmd.jrt.log.Logger
*/
public interface Log {
/**
* Logs a debug message.
*
* @param contexts the list of contexts.
* @param message the message.
* @param throwable the optional throwable or null.
*/
void dbg(@Nonnull List