-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better logging gui #2725
Better logging gui #2725
Conversation
I have found some problems @hannesa2 . 1- I got an infinity loop clearing logfile 2- stopLogging is not used anywhere 3- Some of these problems are still reproducible (It would be interesting to solve them) |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thanks @hannesa2 . Moving this forward
Ready to QA @jesmrec |
@hannesa2 it is very appreciated. Also, it'd be appreciated if the library PR: owncloud/android-library#275 is moved to the oC repo as well. |
(1) [NR]The log searching is case-sensitive. This is a bit tricky, since the main target is getting matches, regardless if capitals are there or not. Is it feasible to set the searching as non case sensitive or is it a Timber feature? |
(2) [FIXED]
Current: nothing happens This took my attention, since other apps in the same device displays the folder picker to share with ownCloud, but the Log app. But, not sure it this is a matter of the library itself. Sharing with other available providers works properly. |
companion object { | ||
private const val logCatTargetFileName = "logfile.log" | ||
private const val logCatSearchHint = "search logcat" | ||
private const val bothLogsTargetFileName = "Owncloud.log" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, don't use Owncloud
as hardcoded string inside the code, due to branding reasons. You can use the app_name or other parameter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(4) [FIXED]About log rotation, every day is created a new file. Long term will flood the app folder with logs. Any way/chance to clean logs (automatically or manually)? Logs are stored in the root folder of the app in the internal storage. Shouldn't be stored in a specific folder called additional ideas welcome |
No need for a file picker anymore. It has just one recent file |
This file logging is pointless since you see in But about flooting: Maybe we should delete all *.log files in that directory during |
It's the behaviour like before. Make an issue and I apply it later. |
(1) -> in the previous log implementation, searching was not case sensitive. For example: (2)
if you open the Log view and you want to sync it in your oC server by sharing, you can't (in the former implementation you could). The option is there and does nothing. IMHO is confusing if you select (3) -> will check the new names. pending. (4)
that works for me. What do you think @abelgardep @davigonz |
@hannesa2 in the report (1) you are right, ignore my answer, since the word So, the behaviour is the same and we are not losing functionality. We can go on with it. |
A: during investigation, I solved a lot of lint issues, but my experience with #2680 told me not to push this, because it causes too much afford. You prefer to go with a bad current state, instead of an improvement which not fit 100% concerning automatic code format B: file chooser |
(4)
When you want to go this way, I'm ready prepared |
Go ahead 👍 |
About #2680 , as @abelgardep pointed in #2680 (comment) , there's some automatic transformations from Java to Kotlin that are a bit dangerous, mostly related to nullability.
Do you mean effort? Code reviews cause effort, it's something usual in a development process, you might probably know that. We do not merge code as it is, if some changes are needed, they should be applied. Otherwise, we will pile up not 100% proper code and it will end up in something not that good.
Yes, I can not give the details about that change but it was needed. I will have a look at it anyway. By the way, I've noticed that there's a duplicated share icon when I install it in a Nexus 6P, any idea? |
(4)
@abelgardep done |
Sorry, I've no such device. I add this share for each fragment separately with
My expectation is that it's only added for recent fragment |
Yesterday I performed the next steps in your library repo:
And the result was what you see in the image below The remote tracking reference is |
(5) [FIXED]Share icon appears as the clear log option when the clear log option has enough room to appear in the top bar. The fix is included via AppDevNext/Logcat#29 , could you check it @hannesa2 ? Thanks |
8138a20
to
dfe1ae8
Compare
@jesmrec all the bugs should already be fixed, could you check them? |
(6) (improvement)After fixing (2) and (3), the name of the logs file to share is always
would it be posible to add the timestamp (same as the log stored in device). So, if some files are stored, can be distinguised. Something like _20191127_101145.log what do you think? |
@@ -51,7 +50,7 @@ class LogHistoryActivity : ToolbarActivity() { | |||
|
|||
fileLoggingTree()?.let { | |||
logFragment = BothLogsFragment.newInstance( | |||
bothLogsTargetFileName, | |||
"${getString(R.string.app_name)}.log", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't debugged it, but is it that smart to use R.string.app_name
? What's about when the app has a name like "my Cloud" with space ?
Leave it like it was and all is fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/hannesa2/Logcat/blob/5cba849239a0d71ef21f69d91c986c875c16b580/LogcatLib/src/main/java/info/hannes/timber/FileLoggingTree.kt#L23-L28 Maybe this on https://github.com/owncloud/android-library/pull/283/files#r351259590 ? But it's up to you. For me it was fine, everything now makes it not better |
sorry, GH text processor played me a trick. What i meant, is using the name of the app as name of the file (what i called there as "<nameApp>.log" and GH ellipsized): ownCloud.log depending on the parameter in so, the improvement will change those names for ownCloud_20191127_101145.log sorry for not reviewing the published comment |
@jesmrec This is not that trivial so I would keep it as it is, just |
Ok, let's keep it ftm... awaiting for more feedback. From my side this is approved. Thanks for the contribution @hannesa2! |
dfe1ae8
to
040fec0
Compare
It's the #2694 but on ownCloud repo, instead of my fork
Implements #2730
Needs owncloud/android-library#283
QA
Test plan: https://github.com/owncloud/QA/blob/master/Mobile/Android/Release_2.14.0/2725%20-%20Timber.md