Skip to content

Conversation

@ezaquarii
Copy link
Collaborator

Fixes #4228

Signed-off-by: Chris Narkiewicz hello@ezaquarii.com

@nextcloud nextcloud deleted a comment Jul 28, 2019
@nextcloud nextcloud deleted a comment Jul 28, 2019
@nextcloud nextcloud deleted a comment Jul 28, 2019
@nextcloud nextcloud deleted a comment Jul 28, 2019
@nextcloud nextcloud deleted a comment Jul 28, 2019
@nextcloud nextcloud deleted a comment Jul 28, 2019
@nextcloud nextcloud deleted a comment Jul 28, 2019
@codecov
Copy link

codecov bot commented Jul 31, 2019

Codecov Report

Merging #4275 into master will increase coverage by 0.34%.
The diff coverage is 61.63%.

@@             Coverage Diff             @@
##             master   #4275      +/-   ##
===========================================
+ Coverage     16.26%   16.6%   +0.34%     
  Complexity        1       1              
===========================================
  Files           340     351      +11     
  Lines         31184   31397     +213     
  Branches       4429    4446      +17     
===========================================
+ Hits           5071    5215     +144     
- Misses        25234   25306      +72     
+ Partials        879     876       -3
Impacted Files Coverage Δ Complexity Δ
...java/com/nextcloud/client/di/ComponentsModule.java 0% <ø> (ø) 0 <0> (ø) ⬇️
...in/java/com/nextcloud/client/di/ViewModelModule.kt 0% <ø> (ø) 0 <0> (ø) ⬇️
.../com/nextcloud/client/logger/ui/LogsEmailSender.kt 0% <0%> (ø) 0 <0> (?)
...com/owncloud/android/ui/activity/LogsActivity.java 0% <0%> (ø) 0 <0> (?)
...owncloud/android/ui/activity/SettingsActivity.java 38.44% <0%> (ø) 0 <0> (ø) ⬇️
...va/com/nextcloud/client/logger/ui/LogsViewModel.kt 0% <0%> (ø) 0 <0> (?)
...java/com/nextcloud/client/logger/ui/LogsAdapter.kt 0% <0%> (ø) 0 <0> (?)
.../main/java/com/nextcloud/client/logger/LogEntry.kt 100% <100%> (ø) 0 <0> (?)
src/main/java/com/owncloud/android/MainApp.java 55.11% <100%> (-0.52%) 0 <0> (ø)
src/main/java/com/nextcloud/client/logger/Level.kt 100% <100%> (ø) 0 <0> (?)
... and 31 more

@nextcloud nextcloud deleted a comment Jul 31, 2019
@nextcloud nextcloud deleted a comment Jul 31, 2019
@nextcloud nextcloud deleted a comment Jul 31, 2019
@nextcloud nextcloud deleted a comment Jul 31, 2019
@nextcloud nextcloud deleted a comment Jul 31, 2019
@nextcloud nextcloud deleted a comment Jul 31, 2019
@nextcloud nextcloud deleted a comment Aug 5, 2019
* Copyright (C) 2019 Chris Narkiewicz <hello@ezaquarii.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is GPL3+, an AppModule for example you used AGPL3+.
While the changes are minor, we encourage APGL3+.
(sorry if I mixed this up and falsly suggested GPL3+…)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I copied the header from other source file - some are GPL3.

It should be all converted to AGPL3 now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it should be really done. (-:

@ezaquarii ezaquarii force-pushed the ezaquarii/new-logger-implementation branch from f34c899 to 888da30 Compare August 6, 2019 14:54
@nextcloud nextcloud deleted a comment Aug 6, 2019
Fixes #4228

Signed-off-by: Chris Narkiewicz <hello@ezaquarii.com>
@ezaquarii ezaquarii force-pushed the ezaquarii/new-logger-implementation branch from 20d8cd7 to 79e8d59 Compare August 6, 2019 20:49
@nextcloud-android-bot
Copy link
Collaborator

… [skip ci]

Signed-off-by: nextcloud-android-bot <android@nextcloud.com>
@nextcloud nextcloud deleted a comment Aug 6, 2019
@nextcloud nextcloud deleted a comment Aug 6, 2019
@nextcloud-android-bot
Copy link
Collaborator

@tobiasKaminsky
Copy link
Member

https://www.kaminsky.me/nc-dev/android-integrationTests/10299/classes/com.nextcloud.client.logger.TestLogger.html

I tried to run these unit tests locally, but I always get:

java.lang.RuntimeException: Method d in android.util.Log not mocked. See http://g.co/androidstudio/not-mocked for details.

	at android.util.Log.d(Log.java)
	at com.nextcloud.client.logger.LoggerImpl.d(LoggerImpl.kt:66)
	at com.nextcloud.client.logger.TestLogger.queue overflow warning is logged(TestLogger.kt:231)

Am I missing something?

@ezaquarii
Copy link
Collaborator Author

ezaquarii commented Aug 7, 2019

@tobiasKaminsky
The only thing coming to my mind is

        testOptions {
            unitTests.returnDefaultValues = true
        }

in gradle. The above is required to enable bare-minimum system API mocks. If you restored the library dependency by restoring entire build.gradle by accident, this is what will happen.

@ezaquarii
Copy link
Collaborator Author

@tobiasKaminsky Testing platform code is tricky. I'm on the fence between having tests on android devices (androidTests) vs grabbing Robolectric. I decided to keep any extra dependencies out as long as we really don't require them.

@tobiasKaminsky
Copy link
Member

If you restored the library dependency by restoring entire build.gradle by accident, this is what will happen.

I did not (yet) changed anything, but only checked it out.
I restart drone and give it also a new clean test locally.

I decided to keep any extra dependencies out as long as we really don't require them.

Good :-) If we come to the point where we have to change this, we should really be sure about the change.

@tobiasKaminsky
Copy link
Member

Interesting. Running TestLogger via Android Studio results in error above.

But running "./gradlew testGplayDebugUnitTest" says that everything works:

com.nextcloud.client.logger.TestLogger > queue overflow warning is logged PASSED

--> so false alarm, but still strange

@tobiasKaminsky
Copy link
Member

After CI, I will merge lib, and do all the needed stuff to get this in.

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
@nextcloud nextcloud deleted a comment Aug 7, 2019
@nextcloud-android-bot
Copy link
Collaborator

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/10311.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.

@nextcloud-android-bot
Copy link
Collaborator

Codacy

278

Lint

TypemasterPR
Warnings5959
Errors00

SpotBugs (new)

Warning TypeNumber
Bad practice Warnings24
Correctness Warnings69
Internationalization Warnings12
Malicious code vulnerability Warnings4
Multithreaded correctness Warnings9
Performance Warnings111
Security Warnings46
Dodgy code Warnings135
Total410

SpotBugs (master)

Warning TypeNumber
Bad practice Warnings24
Correctness Warnings69
Internationalization Warnings12
Malicious code vulnerability Warnings4
Multithreaded correctness Warnings9
Performance Warnings112
Security Warnings46
Dodgy code Warnings136
Total412

@tobiasKaminsky tobiasKaminsky merged commit 3eecc09 into master Aug 7, 2019
@tobiasKaminsky tobiasKaminsky deleted the ezaquarii/new-logger-implementation branch August 7, 2019 13:32
@AndyScherzinger AndyScherzinger added this to the Nextcloud App 3.8.0 milestone Aug 7, 2019
tobiasKaminsky added a commit that referenced this pull request Aug 8, 2019
3eecc09 New logger implementation (#4275)
d79f8ee use headless emulator (#4296)
7050933 revert library to master
612c2bd Bump json from 20180813 to 20190722 (#4298)
7ef012a [tx-robot] updated from transifex
7f87ba2 Bump json from 20180813 to 20190722
9ff067f Drone: update FindBugs results to reflect reduced error/warning count [skip ci]
eaa24f1 Merge commit '79e8d59aa185d4c2fe728f4920df8e3511803d6d'
79e8d59 New logger implementation
329abff [tx-robot] updated from transifex
41c9ff1 daily dev 20190806
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Log_OC doesn't collect logs in file

5 participants