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

com.kaltura.client.LoggerOut Maven / Gradle / Ivy

Go to download

KalturaClient is a library of Java classes that can be used to interact with the Kaltura REST API. More information about the REST API can be found at http://corp.kaltura.com/Products/Kaltura-API Many of the Java classes in this library are auto-generated from a schema that defines the objects that are used to interect with the API. The current schema can be found at http://www.kaltura.com/api_v3/api_schema.php

There is a newer version: 19.3.0
Show newest version
package com.kaltura.client;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by tehilarozin on 24/08/2016.
 */
public class LoggerOut implements ILogger {
    @Override
    public boolean isEnabled() {
        return true;
    }

    @Override
    public void trace(Object message) {
        systemOutMsg("trace: ", message);
    }

    @Override
    public void debug(Object message) {
        systemOutMsg("debug: ", message);
    }

    @Override
    public void info(Object message) {
        systemOutMsg(">> info: ", message);
    }

    @Override
    public void warn(Object message) {
        systemOutMsg("# warn: ", message);
    }

    @Override
    public void error(Object message) {
        systemOutMsg("** error: ", message);
    }

    @Override
    public void fatal(Object message) {
        systemOutMsg("!! fatal: ", message);
    }

    @Override
    public void trace(Object message, Throwable t) {
        systemOutMsg("traceThrowable: ", message + "\n "+t);
    }

    @Override
    public void debug(Object message, Throwable t) {
        systemOutMsg("debugThrowable: ", message + "\n "+t);
    }

    @Override
    public void info(Object message, Throwable t) {
        systemOutMsg(">> infoThrowable: ", message + "\n "+t);
    }

    @Override
    public void warn(Object message, Throwable t) {
        systemOutMsg("# warnThrowable: ", message + "\n "+t);
    }

    @Override
    public void error(Object message, Throwable t) {
        systemOutMsg("** errorThrowable: ", message + "\n "+t);
    }

    @Override
    public void fatal(Object message, Throwable t) {
        systemOutMsg("!! fatalThrowable: ", message + "\n "+t);
    }


    private void systemOutMsg(String prefix, Object message) {
        System.out.println(getTime() + prefix + message+"\n");
    }

    public static ILogger getLogger(String name) {
        return new LoggerOut();
    }

    public static String getTime(){
        return new SimpleDateFormat("HH.mm.ss.SSS").format(new Date()) + ": ";
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy