If you think the Android project kakao-android-sdk-standalone 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
/**
* Copyright 2014 Kakao Corp.//www.java2s.com
*
* Redistribution and modification in source or binary forms are not permitted without specific prior written permission.
*
* 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 com.kakao.helper;
import android.util.Log;
/**
* Logging??? ?? Logger ?????
*/publicclass Logger {
publicstaticenum LogLevel {
Verbose, Debug, Info, Warn, Error, Release
}
privatestaticfinal String TAG = "kakao-android-sdk";
privatevolatilestatic Logger instance;
private LogLevel logLevel;
private Logger() {
super();
this.logLevel = LogLevel.Debug;
}
publicstatic Logger getInstance() {
if (instance == null) {
synchronized (Logger.class) {
if (instance == null) instance = new Logger();
}
}
return instance;
}
publicvoid setLogLevel(LogLevel logLevel) {
this.logLevel = logLevel;
}
publicboolean isLoggable(LogLevel logLevel){
return this.logLevel.compareTo(logLevel) <= 0;
}
publicvoid v(String msg) {
v(TAG, msg);
}
publicvoid d(String msg) {
d(TAG, msg);
}
publicvoid i(String msg) {
i(TAG, msg);
}
publicvoid w(String msg) {
w(TAG, msg);
}
publicvoid e(String msg) {
e(TAG, msg);
}
void v(String tag, String msg) {
switch (logLevel) {
case Verbose:
Log.v(tag, msg);
break;
}
}
publicvoid d(String tag, String msg) {
switch (logLevel) {
case Verbose:
case Debug:
Log.d(tag, msg);
break;
}
}
void i(String tag, String msg) {
switch (logLevel) {
case Verbose:
case Debug:
case Info:
Log.i(tag, msg);
break;
}
}
publicvoid w(String tag, String msg) {
switch (logLevel) {
case Verbose:
case Debug:
case Info:
case Warn:
Log.w(tag, msg);
break;
}
}
void e(String tag, String msg) {
switch (logLevel) {
case Verbose:
case Debug:
case Info:
case Warn:
case Error:
Log.e(tag, msg);
break;
}
}
publicvoid v(Throwable tr) {
v(TAG, tr);
}
publicvoid d(Throwable tr) {
d(TAG, tr);
}
publicvoid i(Throwable tr) {
i(TAG, tr);
}
publicvoid w(Throwable tr) {
w(TAG, tr);
}
publicvoid e(Throwable tr) {
e(TAG, tr);
}
void v(String tag, Throwable tr) {
switch (logLevel) {
case Verbose:
Log.v(tag, tr.getLocalizedMessage(), tr);
break;
}
}
void d(String tag, Throwable tr) {
switch (logLevel) {
case Verbose:
case Debug:
Log.d(tag, tr.getLocalizedMessage(), tr);
break;
}
}
publicvoid i(String tag, Throwable tr) {
switch (logLevel) {
case Verbose:
case Debug:
case Info:
Log.i(tag, tr.getLocalizedMessage(), tr);
break;
}
}
publicvoid w(String tag, Throwable tr) {
switch (logLevel) {
case Verbose:
case Debug:
case Info:
case Warn:
Log.w(tag, tr.getLocalizedMessage(), tr);
break;
}
}
void e(String tag, Throwable tr) {
switch (logLevel) {
case Verbose:
case Debug:
case Info:
case Warn:
case Error:
Log.e(tag, tr.getLocalizedMessage(), tr);
break;
}
}
}