Skip to content
This repository has been archived by the owner on Mar 16, 2021. It is now read-only.

Use the same logging interface everywhere #14

Merged
merged 7 commits into from
Sep 27, 2016
Merged

Use the same logging interface everywhere #14

merged 7 commits into from
Sep 27, 2016

Conversation

passsy
Copy link
Contributor

@passsy passsy commented Sep 26, 2016

TiLog.setLogger(null)

  • allows custom loggers
  • disable logging is now possible

Fixes logging with java.util.logging.Logger not being visible because the where printed with log level FINE which is not printed when the library isn't in debug mode.

issues #13

combine with Timber:

Timber.plant(new Timber.DebugTree());
TiLog.setLogger(new TiLog.Logger() {
    @Override
    public void log(final int level, final String tag, final String msg) {
        Timber.tag(tag).log(level, msg);
    }
});

`TiLog.setLogger(null)`
- allows custom loggers
- disable logging is now possible

Logs by default to Timber
@passsy
Copy link
Contributor Author

passsy commented Sep 26, 2016

Not sure if the logger should be null by default.


private static final String TAG = "ThirtyInch";

// logs everything to Timber by default
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong since 4da934b

}

TiLog() {
throw new AssertionError("no instances");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just setting constructor to private?

@StefMa
Copy link
Contributor

StefMa commented Sep 27, 2016

LGTM 👍

@StefMa StefMa merged commit 265febf into master Sep 27, 2016
@passsy passsy deleted the feature/logging branch September 27, 2016 12:37
@passsy passsy added this to the 0.8.0 milestone Oct 21, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

2 participants