FileLogger - a library for saving logs on Files with custom-formatter on background I/O threads, mobile-ready, android compatible,

Related tags

Logger FileLogger
Overview

FileLogger

The FileLogger is a library for saving logs on Files with custom-formatter on background I/O threads, mobile-ready, android compatible, powered by Java Time library for Android.

Features

  • Write log file on file
  • Working on I/O thread
  • Using java FastDateTime
  • Support INFO, ERROR, DEBUG, WARNING logging level

TODO

  1. Add C++ NDK support
  2. Mail logs
  3. Upload on http server
  4. Encrypt important logs

Usage

Init:

val config = Config.Builder(it.path)
    .setDefaultTag("TAG")
    .setLogcatEnable(true)
    .setDataFormatterPattern("dd-MM-yyyy-HH:mm:ss")
    .build()

FileLogger.init(config)

Log:

FileLogger.i("TAG", "This is normal Log with custom TAG")
FileLogger.i(msg = "This is normal Info Log")
FileLogger.d(msg = "This is normal Debug Log")
FileLogger.w(msg = "This is normal Warning Log")
FileLogger.e(msg = "This is normal Error Log")

Exception:

try {
    //...
} catch (e: Exception) {
    FileLogger.e(msg = "log message", throwable = e)
}

Delete log files:

FileLogger.deleteFiles()

Enable and disable logging:

FileLogger.setEnable(boolean)

Log Sample

File logger initialized at 06-03-2022-16:04:51 

06-03-2022-16:05:58 I/Custom: This is normal Log with custom TAG
06-03-2022-16:05:58 I/TAG: This is normal Info Log
06-03-2022-16:05:58 D/TAG: This is normal Debug Log
06-03-2022-16:05:58 W/TAG: This is normal Warning Log
06-03-2022-16:05:58 E/TAG: This is normal Error Log
06-03-2022-16:06:00 E/TAG: This is exception
            abbasi.android.filelogger.sample.MainActivity.onCreate$lambda-3(MainActivity.kt:37)
            abbasi.android.filelogger.sample.MainActivity.$r8$lambda$DvDQAirnZLyytJNiMziZSY8Ukuc(Unknown Source:0)
            abbasi.android.filelogger.sample.MainActivity$$ExternalSyntheticLambda0.onClick(Unknown Source:2)
            android.view.View.performClick(View.java:7448)
            com.google.android.material.button.MaterialButton.performClick(MaterialButton.java:1131)
            android.view.View.performClickInternal(View.java:7425)
            android.view.View.access$3600(View.java:810)
            android.view.View$PerformClick.run(View.java:28305)
            android.os.Handler.handleCallback(Handler.java:938)
            android.os.Handler.dispatchMessage(Handler.java:99)
            android.os.Looper.loop(Looper.java:223)
            android.app.ActivityThread.main(ActivityThread.java:7656)
            java.lang.reflect.Method.invoke(Native Method)
            com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
            com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

Installation

Add it in your root build.gradle at the end of repositories:

allprojects {
	repositories {
		maven { url 'https://jitpack.io' }
	}
}

Add the dependency

dependencies { 
    implementation 'com.github.aabolfazl:filelogger:1.0.0'
}

License

MIT License
Copyright(c) 2022 Abolfazl Abbasi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
You might also like...
✔️ Simple, pretty and powerful logger for android
✔️ Simple, pretty and powerful logger for android

Logger Simple, pretty and powerful logger for android Setup Download implementation 'com.orhanobut:logger:2.2.0' Initialize Logger.addLogAdapter(new A

Example application using Bugfender SDK in Android
Example application using Bugfender SDK in Android

Bugfender Android SDK SDK Installation Here are the main points to getting Bugfender working on your apps: Get an app key at bugfender.com Add Bugfend

📄The reliable, generic, fast and flexible logging framework for Android
📄The reliable, generic, fast and flexible logging framework for Android

logback-android v2.0.0 Overview logback-android brings the power of logback to Android. This library provides a highly configurable logging framework

Kotlin Multi Platform Logger, for android an ios : Logcat & print

Multiplatform Preferences Use a single object : Logger in your kotlin shared projects to display logs Note you can also use it in your real code on An

A tiny Kotlin API for cheap logging on top of Android's normal Log class.
A tiny Kotlin API for cheap logging on top of Android's normal Log class.

A tiny Kotlin API for cheap logging on top of Android's normal Log class.

An easy way to customize your log in Android,including output to console, writing log to file in high performance way and so on

EasyLog An easy way to customize your log in Android,including output to console, writing log to file in high performance way and so on. 1. Initializa

Native-Blur: a C++/Kotlin library for blur bitmaps and activity, mobile-ready, android compatible
Native-Blur: a C++/Kotlin library for blur bitmaps and activity, mobile-ready, android compatible

Native-Blur The Native-Blur is a C++/Kotlin libraray for blur bitmaps and activity, mobile-ready, android compatible, powered by Java Native Interface

KMP Ready is a Gradle Plugin that provides actionable advice to make your code Kotlin Multiplatform compatible.

KMP Ready IS 🚧 UNDER DEVELOPMENT 🚧 Decisioning Logic Positive Signals ✅ Only Kotlin .kt Source Files Using Kotlin JVM Plugin Uses the Kotlin Multipl

CalEF (Calendar Entry Formatter) : Select an entry in Android-Kalender and send/share the entry's content as human readable text.

CalEF (Calendar Entry Formatter) Select an entry in Android-Kalender and send/share the entry's content as human readable text. Usually calendar entri

An anti-bikeshedding Kotlin linter with built-in formatter
An anti-bikeshedding Kotlin linter with built-in formatter

Kotlin linter in spirit of feross/standard (JavaScript) and gofmt (Go). Features No configuration.* Which means no decisions to make, nothing to argue

Easily upload files (Multipart/Binary/FTP out of the box) in the background with progress notification. Support for persistent upload requests, customizations and custom plugins.
Easily upload files (Multipart/Binary/FTP out of the box) in the background with progress notification. Support for persistent upload requests, customizations and custom plugins.

ℹ️ 🆕 Get started with 4.x 👉 Try it out Get the demo APK Still using 3.x ? It's not maintained or supported. You may have security issues and problem

Send Whatsapp Message Without Saving Mobile Number

Send Whatsapp Message Without Saving Mobile Number In this project i created the

Asynchronous socket, http(s) (client+server) and websocket library for android. Based on nio, not threads.

AndroidAsync AndroidAsync is a low level network protocol library. If you are looking for an easy to use, higher level, Android aware, http request li

A lightweight eventbus library for android, simplifies communication between Activities, Fragments, Threads, Services, etc.
A lightweight eventbus library for android, simplifies communication between Activities, Fragments, Threads, Services, etc.

AndroidEventBus This is an EventBus library for Android. It simplifies the communication between Activities, Fragments, Threads, Services, etc. and lo

LiteGo is a Java-based asynchronous concurrency library. It has a smart executor, which can be freely set the maximum number of concurrent at same time , and the number of threads in waiting queue. It can also set waiting policies and overload strategies.

LiteGo:「迷你」的Android异步并发类库 LiteGo是一款基于Java语言的「异步并发类库」,它的核心是一枚「迷你」并发器,它可以自由地设置同一时段的最大「并发」数量,等待「排队」线程数量,还可以设置「排队策略」和「超载策略」。 LiteGo可以直接投入Runnable、Callable

Event bus for Android and Java that simplifies communication between Activities, Fragments, Threads, Services, etc. Less code, better quality.
Event bus for Android and Java that simplifies communication between Activities, Fragments, Threads, Services, etc. Less code, better quality.

EventBus EventBus is a publish/subscribe event bus for Android and Java. EventBus... simplifies the communication between components decouples event s

Realtime, Accurate Background Changer, Portrait Segmentation, Portrait Matting, Background Removal for Android

Realtime Background Changer on Camera Stream Realtime, Accurate Background Changer, Portrait Segmentation, Portrait Matting, Background Removal SDK fo

🧶 Library to handling files for persistent storage with Google Cloud Storage and Amazon S3-compatible server, made in Kotlin

🧶 Remi Library to handling files for persistent storage with Google Cloud Storage and Amazon S3-compatible server, made in Kotlin! Why is this built?

A small navigation library for Jetpack Compose with state saving, backstack and animations support.

A small navigation library for Jetpack Compose with state saving, backstack and animations support.

Releases(1.0.2)
Owner
Abolfazl Abbasi
At days Android engineer, at nights Linux developer and Electronic researcher
Abolfazl Abbasi
simple Kotlin logging: colorized logs for Kotlin on the JVM

sklog - simple Kotlin logging Kotlin (JVM) logging library for printing colorized text to the console, with an easy upgrade path to the popular kotlin

null 1 Jul 26, 2022
Pluto Logger is a Pluto plugin to manage and share your Debug logs

Pluto Logger Plugin Pluto Logger is a Pluto plugin to manage and share your Debug logs. It also comes with Timber support. ?? Integrate plugin in your

Pluto 1 Feb 8, 2022
Gadget is a library that makes analytics tracking easier for android apps

gadget (In RC Stage) Gadget is a library that makes analytics tracking easier for android apps.

Taylan Sabırcan 54 Nov 29, 2022
An in-display logging library for Android 📲

Vlog provides an easy and convenient way to access logs right on your phone.

girish budhwani 121 Dec 26, 2022
Napier is a logger library for Kotlin Multiplatform.

Napier is a logger library for Kotlin Multiplatform. It supports for the android, ios, jvm, js. Logs written in common module are displayed on logger

Akira Aratani 457 Jan 7, 2023
This is an Kotlin Library that enables Annotation-triggered method call logging for Kotlin Multiplatform.

This is an Kotlin Library that enables Annotation-triggered method call logging for Kotlin Multiplatform.

Jens Klingenberg 187 Dec 18, 2022
Library that makes debugging, log collection, filtering and analysis easier.

AndroidLogger Android Library that makes debugging, log collection, filtering and analysis easier. Contains 2 modules: Logger: 'com.github.ShiftHackZ.

ShiftHackZ 2 Jul 13, 2022
Kotlin multi-platform logging library with structured logging and coroutines support

Klogging Klogging is a pure-Kotlin logging library that aims to be flexible and easy to use. It uses Kotlin idioms for creating loggers and sending lo

Klogging 51 Dec 20, 2022
Jambo is an open source remote logging library

Jambo Jambo is an open source remote logging library. For those who would like to see their logs remotely on their android device Jambo is the library

Tabasumu 6 Aug 26, 2022
A logger with a small, extensible API which provides utility on top of Android's normal Log class.

This is a logger with a small, extensible API which provides utility on top of Android's normal Log class. I copy this class into all the little apps

Jake Wharton 9.9k Jan 8, 2023