MCPcopy Index your code
hub / github.com/cSploit/android / Logger

Class Logger

cSploit/src/org/csploit/android/core/Logger.java:5–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3import android.util.Log;
4
5public class Logger
6{
7 private static final String TAG = "CSPLOIT";
8 private static final String mClassName = Logger.class.getName();
9
10 private static void log( int priority, String message ) {
11 StackTraceElement[] els = Thread.currentThread().getStackTrace();
12 String className, methodName;
13
14 className = methodName = "unknown";
15
16 for( StackTraceElement element : els) {
17 String currClassName = element.getClassName();
18 if(currClassName.startsWith("org.csploit.android.") && !currClassName.equals(mClassName)) {
19 className = currClassName.replace("org.csploit.android.", "");
20 methodName = element.getMethodName();
21 break;
22 }
23 }
24
25 if(message == null)
26 message = "(null)";
27
28 Log.println( priority, TAG + "[" + className + "." + methodName + "]", message );
29 }
30
31 public static void debug( String message ){
32 log( Log.DEBUG, message );
33 }
34
35 public static void info( String message ){
36 log( Log.INFO, message );
37 }
38
39 public static void warning( String message ){
40 log( Log.WARN, message );
41 }
42
43 public static void error( String message ){
44 log( Log.ERROR, message );
45 }
46}

Callers

nothing calls this directly

Calls 1

getNameMethod · 0.65

Tested by

no test coverage detected