-
Notifications
You must be signed in to change notification settings - Fork 4
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 and separate reflect
artifact
#786
Conversation
# Conflicts: # build.gradle.kts # license-report.md # pom.xml # version.gradle.kts
Also: * Fix call sites in `io.spine.logging`
} | ||
|
||
@Test | ||
fun `assume 'SEVER' for errors`() { |
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.
fun `assume 'SEVER' for errors`() { | |
fun `assume 'SEVERE' for errors`() { |
} | ||
|
||
@Test | ||
fun `obtain same 'FluentLogger' Instance`() { |
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.
fun `obtain same 'FluentLogger' Instance`() { | |
fun `obtain same 'FluentLogger' instance`() { |
reflect/build.gradle.kts
Outdated
module | ||
`maven-publish` | ||
`kotlin-jvm-module` | ||
`dokka-for-kotlin` | ||
idea | ||
`project-report` | ||
`detekt-code-analysis` |
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.
Can kotlin-jvm-module
apply module
on its own? It looks like kotlin-jvm-module
is already module
but with some additional stuff.
And some of these plugins are already applied in module
. This block can be shortened.
var handle = Invokables.asHandle(method); | ||
Truth.assertThat(handle).isNotNull(); |
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.
Looks like imports were badly optimized. Static imports are in place, but seem to be not used.
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.
@alexander-yevsyukov LGTM except for the comment related to Ruby set up.
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.
@alexander-yevsyukov please see a couple more minor comments.
rootFolder.set(rootDir) | ||
} | ||
} | ||
|
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.
This line is redundant.
@@ -117,38 +113,38 @@ void throwOnInvocationError() throws NoSuchMethodException { | |||
@DisplayName("convert a visible method to a handle") | |||
void convertToHandle() throws Throwable { | |||
var method = ClassWithPrivateMethod.class.getMethod("publicMethod"); | |||
var handle = asHandle(method); | |||
var handle = Invokables.asHandle(method); |
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.
Maybe, we should rollback to static imports, as previously?
@@ -62,50 +56,41 @@ class TypesTest extends UtilityClassTest<Types> { | |||
@Test | |||
@DisplayName("create a map type") | |||
void createMapType() { | |||
var type = mapTypeOf(String.class, Integer.class); | |||
var type = Types.mapTypeOf(String.class, Integer.class); |
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.
Maybe, we should use static imports, as before?
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.
@alexander-yevsyukov LGTM.
This PR improves modularity of the
base
project, introducing two new modules,logging
andreflect
. The aim is to later extract these modules into a dedicated repositories and develop them separately.'The
logging
module is organized as Kotlin multiplatform project. Several adjustments were necessary to adopt our build scripts for supporting Kotlin KMM. These adjustments will be migrated toconfig
in one of the following PRs.Logging API improvements
The extracted
logging
module is a Kotlin multi-platform module, which introduces fluent logging API inspired by Flogger but in Kotlin.The logging API introduces a notion of
LoggingDomain
which allows to group classes with logging instructions into a namespace. This namespace is added as a prefix to log messages of these classes in the following format:In addition to the
LoggingDomain
Kotlin annotation class, a Java annotation interfaceJvmLoggingDomain
was introduced. The Java annotation allows to annotate both types and packages, and it is used for lookup of a logging domain declared in a package ”hierarchy” from innermost to outermost.An expected object called
LoggingFactory
was introduced with the JVM implementation of it.Kotlin classes in need of logging now may use
WithLogging
interface, which exposes alogger
property. It is expected that theLogging
interface currently used from both Java and Kotlin would be later deprecated in favor ofWithLogging
. But it's too early to say it for sure.Other notable changes
LoggingApi
provided by theLogging
interface was fixed so that it refers to the real class which calls logging instructions.buildSrc/.../kotlin/DokkaExts.kt
, making the closer to the script plugins that use these extensions.PublishingExts.kt
.base
module no longer depends on reflection utilities. Onlylogging
does.jacoco-kmm-jvm.gradle.kts
) was added to address specifics of code coverage in a KMM project.Improvements to the
reflect
moduleAnnotatedPackages
class was introduced to simplify working with annotations of nested packages.Deprecations and removals
Types.isMessageClass(Class)
is deprecated in favor of Kotlin extension functionType.isMessageClass()
introduced in thebase
module.PublishingRepos
formaven.teamdev.com
were removed as these repositories are not used for quite a long time.