yuriykulikov / AlarmClock

Most popular open source Android Alarm Clock App
514 stars 173 forks source link

Logs: Add a file ring buffer writer and cleanup the logs #365

Closed yuriykulikov closed 3 years ago

yuriykulikov commented 3 years ago

Logs: Add a file ring buffer writer and cleanup the logs

Summary

Logs: Add a file ring buffer writer and cleanup the logs

Motivation

There will be less irrelevant logs to read through, but we will have information from previous runs.

Description

Carefully examine a log and see what is redundant and can be removed or joined. Add an slf4j logger, add a logback logger which logs to a file and to the logcat

Drawbacks, risks and assumptions

We can hide crucial information. Files can be become too big or leak

Rationale and alternatives

Just clean up the logs would also be possible.

kolanse commented 3 years ago

okay @yuriykulikov can i work on this?

yuriykulikov commented 3 years ago

Sure. Take a look at logback I guess.

kolanse commented 3 years ago

yeah i will . thank you

yuriykulikov commented 3 years ago

Let me know if you have trouble with the logger we have in the app. To make sure that we are on the same page: the logger itself should not be changed, nor any other classes in the app. But the implementation of the logger can be replaced with something which delegates to an slf4j logger with a logback behind it. Then logback should log into the logcat and into a ring buffered file. This file should then be added to acra report.

kolanse commented 3 years ago

Alright . Sorry i have been busy for the past few days with interviews and work .. will take a look tomorrow and give you feedback if i encounter anything i need clarity on.

yuriykulikov commented 3 years ago

Sure, take your time. Any contribution is welcome and there is no pressure at all. I don't know what your experience is, I gladly support students and developers who start their careers, so don't hesitate to ask if you have any questions. Cheers

On Sat, Jul 31, 2021, 22:13 Samuel Ochuba @.***> wrote:

Alright . Sorry i have been busy for the past few days with interviews and work .. will take a look tomorrow and give you feedback if i encounter anything i need clarity on.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/yuriykulikov/AlarmClock/issues/365#issuecomment-890392592, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGKDEVH3OZYW64ZTAI3LLTT2RDM7ANCNFSM5A6M6DIA .

kolanse commented 3 years ago

Thank you very much. I appreciate it

kolanse commented 3 years ago

@yuriykulikov did a little bit of research on the comment where you talked about adding slf4j logger to the application. i discovered this library that makes it possible to add it to an android project. this is the android library . so i was wondering is it okay to add it

yuriykulikov commented 3 years ago

Looks promising! Good find😉

I guess we are looking at the Rolling FileAppender? https://github.com/tony19/logback-android/wiki/Appender-Notes#configuration-in-code

Also, I very much prefer confutation in Code over XML😃

And we should keep the Logger interface which is already there.

kolanse commented 3 years ago

alright nice . i will try it out

yuriykulikov commented 3 years ago

I will takeover, because I need this for the next release. I will use logback-android found by @kolanse . Cheers

kolanse commented 3 years ago

Thank you @yuriykulikov . I will be very much interested in knowing how it works

yuriykulikov commented 3 years ago

@kolanse check this out: https://github.com/yuriykulikov/AlarmClock/pull/384