Here is the android.util.Log
source code.
At the very bottom (line 340), what is in the method:
public static native int println_native(int bufID,
int priority, String tag, String msg);
i guess println_native()
is more or less like its println()
, just with an int bufID
different.
But even i got the codes of println_native()
, i still lack com.android.internal.os.RuntimeInit
(line 19, the import
) to simulate android.util.Log
in old Android version.
Once you have downloaded the sdk, you can use
find
to dig files. Java code is linked to cpp code through jni.In your case, you can use this command to find the related files:
then you'll see that your java function is linked to this file : framework/base/core/jni/android_util_Log.cpp
Just did some digging in the android source code. This function maps to
Basically this then passes the arguments to the driver in the system which goes and writes to the Log buffer. Log buffer is pointed by
/dev/log
in the Linux kernel.