{"id":17877745,"url":"https://github.com/yshrsmz/historian","last_synced_at":"2026-01-16T21:21:30.873Z","repository":{"id":53610559,"uuid":"79436157","full_name":"yshrsmz/historian","owner":"yshrsmz","description":"Custom Timber tree implementation that can save logs to SQLite","archived":false,"fork":false,"pushed_at":"2021-03-21T08:03:34.000Z","size":315,"stargazers_count":24,"open_issues_count":2,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-18T08:22:18.872Z","etag":null,"topics":["android","android-library","logging","sqlite","sqlite-android"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yshrsmz.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-19T09:15:51.000Z","updated_at":"2023-09-08T17:19:38.000Z","dependencies_parsed_at":"2022-08-24T14:42:26.595Z","dependency_job_id":null,"html_url":"https://github.com/yshrsmz/historian","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yshrsmz%2Fhistorian","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yshrsmz%2Fhistorian/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yshrsmz%2Fhistorian/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yshrsmz%2Fhistorian/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yshrsmz","download_url":"https://codeload.github.com/yshrsmz/historian/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244912800,"owners_count":20530764,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-library","logging","sqlite","sqlite-android"],"created_at":"2024-10-28T11:55:21.934Z","updated_at":"2026-01-16T21:21:30.867Z","avatar_url":"https://github.com/yshrsmz.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Historian\n===\n\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Historian-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/5329)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/net.yslibrary.historian/historian-core/badge.svg)](https://maven-badges.herokuapp.com/maven-central/net.yslibrary.historian/historian-core)\n\nHistorian is a custom [Timber](https://github.com/JakeWharton/timber).Tree implementation that saves logs to SQLite, so that you can see/download the SQLite file later for debugging.\n\nThis library is primarily made to help debugging crash in consumers' devices.\n\n## Requirements\n\n- minSdk 21+\n\n## Installation\n\nHistorian is distributed via Maven Central. [![Maven Central](https://maven-badges.herokuapp.com/maven-central/net.yslibrary.historian/historian-core/badge.svg)](https://maven-badges.herokuapp.com/maven-central/net.yslibrary.historian/historian-core)\n\n```kotlin\ndependencies {\n  implementation(\"net.yslibrary.historian:historian-core:0.6.0\")\n  implementation(\"net.yslibrary.historian:historian-tree:0.6.0\")\n  implementation(\"com.jakewharton.timber:timber:5.0.1\")\n}\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eGroovy DSL\u003c/summary\u003e\n\n```gradle\ndependencies {\n  implementation 'net.yslibrary.historian:historian-core:0.6.0'\n  implementation 'net.yslibrary.historian:historian-tree:0.6.0'\n  implementation 'com.jakewharton.timber:timber:5.0.1'\n}\n```\n\u003c/details\u003e\n\n## Usage\n\n### Kotlin\n\n```kotlin\nclass App : Application() {\n\n    lateinit var historian: Historian\n\n    override fun onCreate() {\n        super.onCreate()\n\n        historian = Historian(this) {\n            // db name. defaults to \"log.db\"\n            name = \"log.db\"\n            // a directory where the db file will be saved. defaults to `context.filesDir`.\n            // The directory will be created if it does not exist.\n            directory = File(getExternalFilesDir(null), \"logs\")\n            // max number of logs stored in db. defaults to 500\n            size = 500\n            // log level to save. defaults to Log.INFO\n            logLevel = Log.INFO\n            // enable debug logs\n            debug = true\n            // optional callbacks\n            onSuccess = Historian.OnSuccessCallback { /* log saved */ }\n            onFailure = Historian.OnFailureCallback { throwable -\u003e /* handle error */ }\n        }\n\n        // initialize historian\n        historian.initialize()\n\n        // plant as Timber tree - using extension function\n        Timber.plant(historian.toTree())\n\n        // delete all saved logs\n        historian.delete()\n\n        // get database path\n        historian.dbPath()\n\n        // graceful shutdown (call from background thread)\n        // historian.terminateSafe()\n    }\n}\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eJava\u003c/summary\u003e\n\n```java\npublic class App extends Application {\n\n    Historian historian;\n\n    @Override\n    public void onCreate() {\n        super.onCreate();\n\n        historian = Historian.builder(this)\n            // db name. defaults to \"log.db\"\n            .name(\"log.db\")\n            // a directory where the db file will be saved. defaults to `context.getFilesDir()`.\n            // The directory will be created if it does not exist.\n            .directory(new File(getExternalFilesDir(null), \"logs\"))\n            // max number of logs stored in db. defaults to 500\n            .size(500)\n            // log level to save\n            .logLevel(Log.INFO)\n            .debug(true)\n            .build();\n\n        // initialize historian\n        historian.initialize();\n\n        Timber.plant(HistorianTree.with(historian));\n\n        // delete all saved logs\n        historian.delete();\n\n        // provide db path\n        historian.dbPath();\n    }\n}\n```\n\u003c/details\u003e\n\n## Table definition\n\n```sql\nCREATE TABLE log(\n  id INTEGER PRIMARY KEY AUTOINCREMENT,\n  priority TEXT NOT NULL,\n  tag TEXT NOT NULL,\n  message TEXT NOT NULL,\n  created_at INTEGER NOT NULL);\n```\n\n\n## License\n\n```\nCopyright 2017-2025 Yasuhiro SHIMIZU (yshrsmz)\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyshrsmz%2Fhistorian","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyshrsmz%2Fhistorian","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyshrsmz%2Fhistorian/lists"}