If you think the Android project android-core listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
/**
* [SIMINOV FRAMEWORK]//www.java2s.com
* Copyright [2015] [Siminov Software Solution LLP|support@siminov.com]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "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.
**/package siminov.core.log;
import android.os.Build;
publicabstractclass Log {
privatestatic String TAG = "SIMINOV";
/**
* Log info messages.
* @param className Class Name.
* @param methodName Method Name.
* @param message Message.
*/publicstaticvoid important(final String className, final String methodName, final String message) {
if(isEmulator()) {
System.out.print(prepareMessage(className, methodName, message));
}
android.util.Log.i(TAG, prepareMessage(className, methodName, message));
}
/**
* Log error messages.
* @param className Class Name.
* @param methodName Method Name.
* @param message Message.
*/publicstaticvoid error(final String className, final String methodName, final String message) {
if(isEmulator()) {
System.out.print(prepareMessage(className, methodName, message));
}
android.util.Log.e(TAG, prepareMessage(className, methodName, message));
}
/**
* Log debug messages.
* @param className Class Name.
* @param methodName Method Name.
* @param message Message.
*/publicstaticvoid debug(final String className, final String methodName, final String message) {
if(isEmulator()) {
System.out.print(prepareMessage(className, methodName, message));
}
android.util.Log.d(TAG, prepareMessage(className, methodName, message));
}
privatestatic String prepareMessage(final String className, final String methodName, final String message) {
return"Class Name: " + className + ", Method Name: " + methodName + ", Message: " + message;
}
privatestaticboolean isEmulator() {
return Build.BRAND.startsWith("generic") && Build.DEVICE.startsWith("generic");
}
}