Joined May 2012
·
Posted to
Cleaner Logging Interface for Android Development.
over 1 year
ago
@segunfamisa
Dope!!
I think this can be minimised though and made easily debuggable.
Here's what I would minimised to :
public class Logger {
private static String TAG = "APP_NAME";
private static boolean DEBUG_ON = false;
public enum LogState{
D, I, W, E;
}
public static void log(LogState ls, String tag, String msg){
if(DEBUG_ON){
switch (ls){
case D:
Log.d(tag, msg);
break;
case I:
Log.i(tag, msg);
break;
case W:
Log.w(tag, msg);
break;
case E:
Log.e(tag, msg);
break;
default:
break;
}
}
}
public static void log(Class<?> cls, LogState ls, String tag, String msg){
if(DEBUG_ON){
switch (ls){
case D:
Log.d(tag, cls.getName() + " "+ msg);
break;
case I:
Log.i(tag, cls.getName() + " "+ msg);
break;
case W:
Log.w(tag, cls.getName() + " "+ msg);
break;
case E:
Log.e(tag, cls.getName() + " "+ msg);
break;
default:
break;
}
}
}
public static void log(Class<?> cls, LogState ls, String msg){
if(DEBUG_ON){
switch (ls){
case D:
Log.d(TAG, cls.getName() + " "+ msg);
break;
case I:
Log.i(TAG, cls.getName() + " "+ msg);
break;
case W:
Log.w(TAG, cls.getName() + " "+ msg);
break;
case E:
Log.e(TAG, cls.getName() + " "+ msg);
break;
default:
break;
}
}
}
}
Posted to
Enabling Cross Origin Resource Sharing (CORS) on Google Chrome for JavaScript API calls and Debugging purposes .
over 1 year
ago
@pmcjury Yeah. But in this particular case, there was no access to the server.
Posted to
Bash Shell, "Shellshock", Security Bug Fix (Ubuntu, CentOS).
over 1 year
ago
@montanaflynn Nice!! Adding it to the protip now.
Posted to
Bash Shell, "Shellshock", Security Bug Fix (Ubuntu, CentOS).
over 1 year
ago
@rajivperera That works. As long as the "vulnerable" doesn't echo. :)
Posted to
ORM Data Persistency Option For Android Development : Sugar
over 1 year
ago
Yeah. You should. :)
Posted to
Fixing Nexus 4 OTA update error on custom recovery "set_metadata_recursive: some changes failed"
over 1 year
ago
@vijay_bhaskar My pleasure. :)
Posted to
Fixing Nexus 4 OTA update error on custom recovery "set_metadata_recursive: some changes failed"
over 1 year
ago
@maraujop You are most welcome sir. :D
Posted to
A basic ruby interview
over 1 year
ago
cool.
Posted to
Installing Copy.com on linux servers (headless linux) to simplify file transfer and deployment.
over 1 year
ago
Added the credits. Apologies once again. :)
Achievements
555 Karma
84,806 Total ProTip Views
Komodo Dragon 3
Have at least three original repos where Java is the dominant language
Mongoose 3
Have at least three original repos where Ruby is the dominant language
Komodo Dragon
Have at least one original repo where Java is the dominant language
Python 3
Have at least three original repos where Python is the dominant language
Charity
Fork and commit to someone's open source project in need
Forked
Have a project valued enough to be forked by someone else
T-Rex
Have at least one original repo where C is the dominant language
Walrus
The walrus is no stranger to variety. Use at least 4 different languages throughout all your repos
Python
Would you expect anything less? Have at least one original repo where Python is the dominant language
Mongoose
Have at least one original repo where Ruby is the dominant language
Epidexipteryx
Have at least one original repo where C++ is the dominant language
@y0UngloRd remind me to almost never have to read your code. :(