All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.dynatrace.buildtools.graalnative.DynatraceLogger Maven / Gradle / Ivy

The newest version!
package com.dynatrace.buildtools.graalnative;

import org.apache.maven.plugin.logging.Log;
import org.codehaus.plexus.logging.Logger;

public interface DynatraceLogger {

	String PREFIX = "[dynatrace-native-maven-plugin] ";

	static DynatraceLogger of(final Logger delegate) {
		return new DynatraceLogger() {
			@Override
			public void info(String pattern, Object... args) {
				delegate.info(String.format(PREFIX + pattern, args));
			}

			@Override
			public void warn(String pattern, Object... args) {
				delegate.warn(String.format(PREFIX + pattern, args));
			}

			@Override
			public void error(String pattern, Object... args) {
				delegate.error(String.format(PREFIX + pattern, args));
			}
		};
	}

	static DynatraceLogger of(final Log delegate) {
		return new DynatraceLogger() {
			@Override
			public void info(String pattern, Object... args) {
				delegate.info(String.format(PREFIX + pattern, args));
			}

			@Override
			public void warn(String pattern, Object... args) {
				delegate.warn(String.format(PREFIX + pattern, args));
			}

			@Override
			public void error(String pattern, Object... args) {
				delegate.error(String.format(PREFIX + pattern, args));
			}
		};
	}

	void info(final String pattern, final Object... args);

	void warn(final String pattern, final Object... args);

	void error(final String pattern, final Object... args);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy