Skip to content
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

Add Logger module #21

Merged
merged 1 commit into from
Mar 20, 2020
Merged

Add Logger module #21

merged 1 commit into from
Mar 20, 2020

Conversation

Lebedinsky
Copy link
Contributor

This PR is about moving Logger from navigation SDK to base-android repo as part of this task

@Lebedinsky Lebedinsky added the enhancement New feature or request label Jan 14, 2020
@Lebedinsky Lebedinsky added this to the 0.0.1 milestone Jan 14, 2020
@Lebedinsky Lebedinsky self-assigned this Jan 14, 2020
@Lebedinsky
Copy link
Contributor Author

@LukasPaczos ptal, and let me know if you'll have comments\another vision on it. Cause I doubt about MapboxNavigationModuleType#Logger and where Logger class should be placed (in navigation project it placed separately from implementation).

Copy link

@LukasPaczos LukasPaczos left a comment

Choose a reason for hiding this comment

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

@Lebedinsky Lebedinsky marked this pull request as ready for review January 15, 2020 09:28
liblogger/build.gradle.kts Outdated Show resolved Hide resolved
Makefile Show resolved Hide resolved
@LukasPaczos
Copy link

We'll also need to initialize the Bintray repository.

@Lebedinsky
Copy link
Contributor Author

Stopped for now due to other priorities

@LukasPaczos LukasPaczos requested a review from a team January 21, 2020 17:26
Copy link
Member

@tobrun tobrun left a comment

Choose a reason for hiding this comment

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

great work @Lebedinsky

gradle.properties Outdated Show resolved Hide resolved
liblogger/build.gradle.kts Outdated Show resolved Hide resolved
liblogger/build.gradle.kts Outdated Show resolved Hide resolved
liblogger/build.gradle.kts Outdated Show resolved Hide resolved
@LukasPaczos
Copy link

The Bintray repo is available in https://bintray.com/mapbox/mapbox/com.mapbox.common%3Alogger. @Lebedinsky whenever you have comments fixed, we can pair and push the version to be able to request the artifactory snapshot repo.

Copy link

@LukasPaczos LukasPaczos left a comment

Choose a reason for hiding this comment

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

LGTM

.circleci/config.yml Outdated Show resolved Hide resolved
Copy link

@LukasPaczos LukasPaczos left a comment

Choose a reason for hiding this comment

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

Sorry for the multiple iterations of comments. It's hard to spot all of the dependencies at first.

*
* @param message The message you would like logged.
*/
data class Message(val message: String)

Choose a reason for hiding this comment

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

maybe use inline classes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@LukasPaczos @Guardiola31337 Are we ok with inline classes? They are still experimental...

Choose a reason for hiding this comment

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

I'd prefer avoiding any experimental APIs as this can mean that down the road bumping the Kotlin compiler on the client-side might break the binary compatibility with the SDK.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I agree with @LukasPaczos let's try to avoid them if possible.

* @param tag used to identify the source of a log message. It usually identifies
* the class or activity where the log call occurs.
*/
data class Tag(val tag: String)

Choose a reason for hiding this comment

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

inline class

import android.util.Log
import com.mapbox.common.logger.model.Message
import com.mapbox.common.logger.model.Tag
import io.mockk.*

Choose a reason for hiding this comment

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

Do you have rule for skipping such check in analyzers (ktlint, etc)?

Copy link
Contributor

Choose a reason for hiding this comment

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

What do you mean? The Wildcard import rule? If so, it doesn't seem it's set in this project.


@Test
fun verboseTestIncorrectLogLevel() {
val throwable = mockk<Throwable>()

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Parameterized tests work pretty well if you want to test multiple inputs and verify their respective expected outputs and in this simple case I don't see how Parameterized / @Parameters would make this test better. How were you envisioning using parameterized tests here @alexander-kulikovskii?

Copy link

@LukasPaczos LukasPaczos left a comment

Choose a reason for hiding this comment

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

LGTM, let's work on setting up artifactory.

@LukasPaczos
Copy link

Thanks for pushing the artifacts @Lebedinsky. I've requested JCenter and Artifactory access, but currently, it's throwing:

Failed to send a message: Empty packages are not allowed in JCenter.

but obviously the package isn't empty. I'm going to give it a shot tomorrow morning again.

@LukasPaczos
Copy link

Still running into the same issue. I do not want to release the package just to request JCenter and Artifactory access, so I wrote a support ticket.

@LukasPaczos
Copy link

I just rebased the PR and tried requesting JCenter access again and failed with this message again:

Failed to send a message: Empty packages are not allowed in JCenter.

Are we good to merge besides that @Lebedinsky? If yes, let's do that and release it to Bintray only. When the package will have a version published, maybe then it'll allow me to request JCenter and Artifactory access.

@Lebedinsky Lebedinsky merged commit 2a09133 into master Mar 20, 2020
@LukasPaczos LukasPaczos deleted the rl-add-logger branch March 20, 2020 18:29
@LukasPaczos
Copy link

After releasing the v0.0.1-alpha.3, there were no more issues with the request for JCenter and Artifactory access 🎉

From now on, the snapshots are being hosted at http://oss.jfrog.org/oss-snapshot-local/com/mapbox/common/logger/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants