view src/ch/ethz/ssh2/log/Logger.java @ 402:14aa0621aa7d stable-1.9.0

Backed out changeset 2f2b5a244a4d
author Carl Byington <carl@five-ten-sg.com>
date Mon, 20 Oct 2014 19:14:39 -0700
parents 4226f87534f4
children
line wrap: on
line source

/*
 * Copyright (c) 2006-2011 Christian Plattner. All rights reserved.
 * Please refer to the LICENSE.txt for licensing details.
 */

package ch.ethz.ssh2.log;

import android.util.Log;

public class Logger {
    private static final String TAG = "ConnectBot.ssh";
    public static boolean enabled = false;

    public static Logger getLogger(Class<?> x) {
        return new Logger();
    }

    public Logger() {
    }

    public final boolean isEnabled() {
        return enabled;
    }

    public boolean isDebugEnabled() {
        return enabled;
    }

    public void debug(String message) {
        if (enabled) Log.d(TAG, message);
    }

    public boolean isInfoEnabled() {
        return enabled;
    }

    public void info(String message) {
        if (enabled) Log.i(TAG, message);
    }

    public boolean isWarningEnabled() {
        return enabled;
    }

    public void warning(String message) {
        if (enabled) Log.w(TAG, message);
    }
}