Historian Tree

Timber(Logging library for Android) Tree implementation for Historian

License

License

Categories

Categories

Net
GroupId

GroupId

net.yslibrary.historian
ArtifactId

ArtifactId

historian-tree
Last Version

Last Version

0.4.0
Release Date

Release Date

Type

Type

aar
Description

Description

Historian Tree
Timber(Logging library for Android) Tree implementation for Historian
Source Code Management

Source Code Management

https://github.com/yshrsmz/historian

Download historian-tree

How to add to project

<!-- https://jarcasting.com/artifacts/net.yslibrary.historian/historian-tree/ -->
<dependency>
    <groupId>net.yslibrary.historian</groupId>
    <artifactId>historian-tree</artifactId>
    <version>0.4.0</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/net.yslibrary.historian/historian-tree/
implementation 'net.yslibrary.historian:historian-tree:0.4.0'
// https://jarcasting.com/artifacts/net.yslibrary.historian/historian-tree/
implementation ("net.yslibrary.historian:historian-tree:0.4.0")
'net.yslibrary.historian:historian-tree:aar:0.4.0'
<dependency org="net.yslibrary.historian" name="historian-tree" rev="0.4.0">
  <artifact name="historian-tree" type="aar" />
</dependency>
@Grapes(
@Grab(group='net.yslibrary.historian', module='historian-tree', version='0.4.0')
)
libraryDependencies += "net.yslibrary.historian" % "historian-tree" % "0.4.0"
[net.yslibrary.historian/historian-tree "0.4.0"]

Dependencies

runtime (1)

Group / Artifact Type Version
net.yslibrary.historian : historian-core jar 0.4.0

Project Modules

There are no modules declared in this project.

Historian

Android Arsenal Maven Central

Historian is a custom Timber.Tree implementation that saves logs to SQLite, so that you can see/download the SQLite file later for debugging.

This library is primarily made to help debugging crash in consumers' devices.

Installation

Historian is distributed via Maven Central. Maven Central

dependencies {
  compile 'net.yslibrary.historian:historian-core:LATEST_LIBRARY_VERSION'
  compile 'net.yslibrary.historian:historian-tree:LATEST_LIBRARY_VERSION'
  compile 'com.jakewharton.timber:timber:4.5.1'
}

Usage

class App extends Application {

    Historian historian;

    @Override
    public void onCreate() {
        historian = Historian.builder(context)
            // db name. defaults to "log.db"
            .name("log.db")
            // a directory where the db file will be saved. defaults to `context.getFiles()`.
            // The directory will be created if it does not exist.
            .directory(new File(Environment.getExternalStorageDirectory(), "somedir"))
            // max number of logs stored in db. defaults to 500
            .size(500)
            // log level to save
            .logLevel(Log.INFO)
            .debug(true)
            .build();

        // initialize historian
        historian.initialize();

        Timber.plant(HistorianTree.with(historian));

        // delete all saved logs
        historian.delete();

        // provide db path in Uri
        historian.dbPath();
    }
}

Table definition

CREATE TABLE log(
  id INTEGER PRIMARY KEY AUTOINCREMENT,
  priority TEXT NOT NULL,
  tag TEXT NOT NULL,
  message TEXT NOT NULL,
  created_at INTEGER NOT NULL);

License

Copyright 2017-2021 Yasuhiro SHIMIZU (yshrsmz)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Versions

Version
0.4.0
0.3.1
0.3.0
0.2.0
0.1.0