-
-
Notifications
You must be signed in to change notification settings - Fork 151
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
feat: Make RawConfig
serializable
#383
base: main
Are you sure you want to change the base?
Conversation
The test i added tests both serialization and deserialization, since the RawConfig can't be constructed programmatically. Should i rename it/the full_deserialize test or remove the full_deserialize test, since the new test incorporates its functionality? |
I would keep the tests, but maybe store the config as a static that all the tests can use instead of copy/pasting it |
@bconn98 So the actual implementation is correct? |
@bconn98 cfg is now a constant. Would you mind checking my implementation for correctness, as I didn't write any custom serializers, however the |
@Creative-Difficulty So this is not good in it's current state. Due to how the library stores things, the default serialized configs can't be parsed by the library. Here is an example of printing out the output generated in your test. refresh_rate:
secs: 60
nanos: 0
root:
level: INFO
appenders:
- console
appenders:
baz:
kind: file
filters: []
config:
encoder:
pattern: '%m'
path: /tmp/baz.log
console:
kind: console
filters:
- kind: threshold
config:
level: debug
config: {}
loggers:
foo::bar::baz:
level: WARN
appenders:
- baz
additive: false Although we don't want to add |
@bconn98 I have a question: The humantime crate used for serializing/deserializing the |
@Creative-Difficulty sounds like a translation is warranted here yup |
@bconn98 In the latest commit serialization of filters and appenders is fixed. Currently 54 tests are passing with 1 failed and 1 ignored. The current output (of refresh_rate: 1m
root:
level: INFO
appenders:
- console
appenders:
baz:
encoder:
pattern: '%m'
filters: '[]'
kind: file
path: /tmp/baz.log
console:
filters:
- kind: threshold
level: debug
kind: console
loggers:
foo::bar::baz:
level: WARN
appenders:
- baz
additive: false
However there are two issues:
How do I proceed? Thank you in advance! |
@bconn98 So is the PR ready? |
All reviews are pending the fix for the deprecated chrono API
|
RawConfig
serializableRawConfig
serializable
RawConfig
serializableRawConfig
serializable
Thank you for the efforts. We'd also like to see this feature merged if possible. |
Related to #382.
I have implemented custom serializers based on the deserializers already in the code.