Default [Q] Hook android.util.Log methods

Hi, I followed the tutorial on github and tried to hook android.util.Log.i(String tag, String msg) method, but I always get a ClassNotFoundError.
I don't know what I did wrong, my code seems so simple.

Edit: I found the solution. The code below works correctly, the problem was in another part of my code.

Here is the code:
Code:
public void handleLoadPackage(final LoadPackageParam lpparam) throws Throwable
    {
        XposedBridge.log("Package name: " + lpparam.packageName);

                try
                {
                        findAndHookMethod("android.util.Log", lpparam.classLoader, "i", String.class, String.class, new XC_MethodHook()
                        {
                            @Override
                            protected void beforeHookedMethod(MethodHookParam param) throws Throwable
                            {
                                //do something before
                            }

                            @Override
                            protected void afterHookedMethod(MethodHookParam param) throws Throwable
                            {
                                //do something after
                            }
                        });
                }
                catch (XposedHelpers.ClassNotFoundError e)
                {
                    XposedBridge.log("ClassNotFoundError");
                }
                catch (NoSuchMethodError e)
                {
                    XposedBridge.log("NoSuchMethodError");
                }
            }
        }
    }