-
Notifications
You must be signed in to change notification settings - Fork 12
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
Custom log site and new black box API #1242
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1242 +/- ##
=========================================
Coverage 91.22% 91.22%
Complexity 4763 4763
=========================================
Files 620 620
Lines 14918 14918
Branches 838 838
=========================================
Hits 13609 13609
Misses 1054 1054
Partials 255 255 |
# Conflicts: # license-report.md # pom.xml # version.gradle
@armiol, PTAL. |
@dmdashenkov, would log tracing improvements work for underscored methods like |
@alexander-yevsyukov, no, they wouldn't. These logging configurations only apply to the logs created via the |
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.
@dmdashenkov LGTM with some minor comments.
Also, as discussed vocally, we probably need to rename AbstractEntity.log()
method into something, which would make it clear, why its invocation result differs from _debug()
, _info()
and others.
|
||
@CheckReturnValue | ||
@ParametersAreNonnullByDefault | ||
package io.spine.server.log.given; |
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 document this package.
} | ||
|
||
message ReturnBook { | ||
LibraryCardId card = 1 [(required) = true, (validate) = true]; |
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.
Do we intend to validate LibraryCardId.reader
? If so, then LibraryCardId
should also say the reader
is required.
@armiol, PTAL again. |
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.
@dmdashenkov as long as you change the PR description, feel free to merge.
Log site
Flogger library provides API for changing the header of log messages via
LogSite
instances. In this PR we add new logging API for all the entities. In a handler method, a user may obtain a preconfigured logger as follows:The resulting log would be similar to:
Implementation details
A new interface
HandlerLifecycle
is introduced. This is a set of callbacks regarding a message handler method invocation.All the entities which extend
AbstractEntity
now implement this interface. The framework users may choose to implement it in other message handlers, namelyAbstractEventReactor
,AbstractEventSubscriber
,AbstractCommander
, andAbstractCommandHandler
subclasses.The framework users may employ the interface for their own needs, such as tracking the performance of the handler methods, adding extra logging, etc.
Custom actor ID for Black Box Bounded Context
With this PR, we add API for configuring the ID and time zone used to produce actor requests in the Black Box Bounded Context.
In some domains, entities and repositories may rely on the details from the
ActorContext
, such as the actor ID. One common use case for this is routing commands by the actor ID.In order to simulate real-life actors in black-box tests, we add the API for changing the actor how posts commands via
BlackBoxBoundedContext
:Also, users may change the time zone ID and offset via the
in
method:Or do both at the same time via the
withActorIn
method:Resolves #1226.