-
Notifications
You must be signed in to change notification settings - Fork 0
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
Redesign base logger API #90
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I'm still working on this but in a minor way: increasing test coverage. I'm not expecting any kind of thorough review -- the change is just too big. But if you browse through it, you might spot something that needs to be addressed. Thanks! |
miccagiann
approved these changes
Apr 5, 2023
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.
Massive PR!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
BREAKING CHANGE
This is a breaking change and major rewrite. Most of the changes are in the base loggers.
Any -> Model, Link
New
Line
finishers have been added:Link()
andModel()
.Link()
as a line attribute has been removed.Any()
remains, butModel()
is now preferredAnyImmutable
AnyImmutable()
line attribute is removedStatic
Static()
line finishers is removed.replay
Base loggers MAY now consume their own output to call other base loggers thus transforming the output from one base logger format to another. Full fidelity replay is supported with
xopotel
,xoppb
,xopjson
, andxoptest
.xoppb
xoppb is a new xop-native protobuf logger. The xop protobuf definitions, in
xopproto
have also changed.xopbase
Baselogger
Request()
now requires aSourceInfo
parameter to define the origin of the logs.Objects (for
Any()
andModel()
) are now passed in aModelArg
object that supports multiple encoding formats.Stack traces are now expanded in the top-level logger rather than in base loggers.
xopjson
Most of the configuration options for xopjson have been removed for the time being. A
xopjs
that is configurable is planned, but not implemented yet.xopotel
The encoding for xop logs in OTEL has changed. Line attributes are now almost all string slices with the second element being a type indicator.
BaseLogger()
now takes aTracerProvider
instead of aTracer
.xoptest
The public data structures have been adjusted in fairly minor ways.
Other misc breaking changes
SeedReactiveCallback
has a slightly different APIBytesWriter
'sDefineAttribute
method has a slightly different API.What was HexByte's
Set()
is nowSetArray()
andSet()
now takes a HexByte.xoputil
'sSkipLine
has moved toxopbase
Backwards compatible changes
WithNamespace()
andWithSource()
seed modifiers have been added and should be used to provide information about the source of the logs.StackFilenameRewrite()
is a newLogSettings
method that can be used to fine-tune stack tracesCombineBaseLoggers()
added that can bundle multiple base loggers into a single logger API. Loggers bundled this way cannot be individually removed from a*Log
.Seed
now has a.String()
for debuggingxopproto
enum types can now Marshal and Unmarshal.Trace
can now Marshal/Unmarshal