Package com.tv.ui.metro.utils;
/*
* Copyright (C) lytsing Huang http://lytsing.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You are not a use this file except in compliance with the License.
* Obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable or agreed to writing, software
* Distributed under the License is distributed on a "as is" BASIS,
* Without warranties or CONDITIONS of any KIND, either express or implied.
* See the License for the specific language governing permissions and
* Limitations under the License.
*/
/**
* Wrapper API for sending log output.
*/
public class _log {
Protected static final String TAG = "MyApplication";
Public _log () {
}
/**
* Send a VERBOSE log message.
* @param msg The message would like logged.
*/
public static void V (String msg) {
ANDROID.UTIL.LOG.V (TAG, Buildmessage (msg));
}
/**
* Send a VERBOSE log message and log the exception.
* @param msg The message would like logged.
* @param thr an exception to log
*/
public static void V (String msg, throwable thr) {
ANDROID.UTIL.LOG.V (TAG, Buildmessage (msg), THR);
}
/**
* Send a DEBUG log message.
* @param msg
*/
public static void D (String msg) {
ANDROID.UTIL.LOG.D (TAG, Buildmessage (msg));
}
public static void DI () {
ANDROID.UTIL.LOG.D (TAG, Buildmessage ("in"));
}
public static void Do () {
ANDROID.UTIL.LOG.D (TAG, Buildmessage ("Out"));
}
/**
* Send a DEBUG log message and log the exception.
* @param msg The message would like logged.
* @param tr an exception to log
*/
public static void D (String msg, throwable thr) {
ANDROID.UTIL.LOG.D (TAG, Buildmessage (msg), THR);
}
/**
* Send an INFO log message.
* @param msg The message would like logged.
*/
public static void I (String msg) {
ANDROID.UTIL.LOG.I (TAG, Buildmessage (msg));
}
/**
* Send a INFO log message and log the exception.
* @param msg The message would like logged.
* @param thr an exception to log
*/
public static void I (String msg, throwable thr) {
ANDROID.UTIL.LOG.I (TAG, Buildmessage (msg), THR);
}
/**
* Send an ERROR log message.
* @param msg The message would like logged.
*/
public static void E (String msg) {
ANDROID.UTIL.LOG.E (TAG, Buildmessage (msg));
}
/**
* Send a WARN log message
* @param msg The message would like logged.
*/
public static void W (String msg) {
ANDROID.UTIL.LOG.W (TAG, Buildmessage (msg));
}
/**
* Send a WARN log message and log the exception.
* @param msg The message would like logged.
* @param thr an exception to log
*/
public static void W (String msg, throwable thr) {
ANDROID.UTIL.LOG.W (TAG, Buildmessage (msg), THR);
}
/**
* Send an empty WARN log message and log the exception.
* @param thr an exception to log
*/
public static void W (Throwable thr) {
ANDROID.UTIL.LOG.W (TAG, Buildmessage (""), THR);
}
/**
* Send an ERROR log message and log the exception.
* @param msg The message would like logged.
* @param thr an exception to log
*/
public static void E (String msg, throwable thr) {
ANDROID.UTIL.LOG.E (TAG, Buildmessage (msg), THR);
}
/**
* Building Message
* @param msg The message would like logged.
* @return Message String
*/
protected static string Buildmessage (String msg) {
Stacktraceelement caller = new Throwable (). Fillinstacktrace (). Getstacktrace () [2];
return new StringBuilder ()
. Append (Caller.getclassname ())
. Append (".")
. Append (Caller.getmethodname ())
. Append ("():")
. Append (msg). toString ();
}
}
Android Log Package