Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not really "backwards-compatible with android.util.Log" #9

Open
silentnuke-old opened this issue Jan 10, 2016 · 0 comments
Open

Not really "backwards-compatible with android.util.Log" #9

silentnuke-old opened this issue Jan 10, 2016 · 0 comments

Comments

@silentnuke-old
Copy link

Readme says: "API is backwards-compatible with android.util.Log, so you already know it."
But there are cases when it's not true, e.g.:

  1. Log.d("mytag", "Hello");
    prints: 'D/LogExampleActivity: mytag Hello' instead of 'D/mytag: Hello'

public class LogExampleActivity extends Activity {

    private String TAG = "mytag";

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.d(TAG, "Hello");
    }
}

prints: 'D/LogExampleActivity: mytag Hello' instead of 'D/mytag: Hello'

public class LogExampleActivity extends Activity {

    private static final String TAG = "mytag";

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.d(TAG, "Hello");
        My.foo();
    }

    public static class My {
        public static void foo() {
            Log.d(TAG, "foobar");
        }
    }
}

prints:
D/mytag: Hello
D/LogExampleActivity$My: mytag foobar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant