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

io.edurt.datacap.core.Logger Maven / Gradle / Ivy

There is a newer version: 2024.4.0
Show newest version
package io.edurt.datacap.core;

import java.util.Arrays;

public class Logger
{
    private final Class mark;

    public Logger(Class mark)
    {
        this.mark = mark;
    }

    public synchronized void log(String format, Object... arguments)
    {
        Object[] objs = Arrays.stream(arguments)
                .map(t -> {
                    if (t instanceof Throwable) {
                        Throwable th = (Throwable) t;
                        return th.getMessage();
                    }
                    return t;
                }).toArray(Object[]::new);
        System.out.printf(mark + ":::" + format + "\n", objs);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy