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

com.virjar.sekiro.log.SekiroLogger Maven / Gradle / Ivy

Go to download

ratel api,used for developer on ratel system,an extension for xposed framewrok,ratel api compatable with original xposed framework

There is a newer version: 1.0.5
Show newest version
package com.virjar.sekiro.log;

import android.util.Log;

import org.slf4j.LoggerFactory;

public class SekiroLogger {
    public static String tag = "Sekiro";

    private static ILogger logger = null;

    static {
        genLogger();
    }

    public static void setLogger(ILogger logger) {
        if (logger == null) {
            throw new IllegalArgumentException("input logger can not be null");
        }
        SekiroLogger.logger = logger;
    }

    private static void genLogger() {
        try {
            Log.i(tag, "test sekiro log");
            logger = new AndroidLogger();
            return;
        } catch (Throwable throwable) {
            //ignore
        }

        try {
            LoggerFactory.getLogger(tag).info("test sekiro log");
            logger = new Slf4jLogger();
            return;
        } catch (Throwable throwable) {
            //ignore
        }
        logger = new SystemOutLogger();
    }

    public static void info(String msg) {
        logger.info(msg);
    }

    public static void info(String msg, Throwable throwable) {
        logger.info(msg, throwable);
    }

    public static void warn(String msg) {
        logger.warn(msg);
    }

    public static void warn(String msg, Throwable throwable) {
        logger.warn(msg, throwable);
    }

    public static void error(String msg) {
        logger.error(msg);
    }

    public static void error(String msg, Throwable throwable) {
        logger.error(msg, throwable);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy