Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

[CBR-423] Structured logging of data structures #3609

Merged

Conversation

365andreas
Copy link
Contributor

@365andreas 365andreas commented Sep 17, 2018

Description

Structured logging of data structures.

Up to the current version of code only Text messages are logged. So we want to log items (besides Text ) that have a ToJSON instance.

Linked issue

CBR-423

Type of change

  • [~] 🐞 Bug fix (non-breaking change which fixes an issue)
  • 🛠 New feature (non-breaking change which adds functionality)
  • [~] ⚠️ Breaking change (fix or feature that would cause existing functionality to change)
  • [~] 🏭 Refactoring that does not change existing functionality but does improve things like code readability, structure etc
  • [~] 🔨 New or improved tests for existing code
  • [~] ⛑ git-flow chore (backport, hotfix, etc)

Developer checklist

  • I have read the style guide document, and my code follows the code style of this project.
  • If my code deals with exceptions, it follows the guidelines.
  • I have updated any documentation accordingly, if needed. Documentation changes can be reflected in opening a PR on cardanodocs.com, amending the inline Haddock comments, any relevant README file or one of the document listed in the docs directory.
  • [~] CHANGELOG entry has been added and is linked to the correct PR on GitHub.

Testing checklist

  • [~] I have added tests to cover my changes.
  • [~] All new and existing tests passed.

QA Steps

Screenshots (if available)

@365andreas 365andreas force-pushed the andreas/CBR-423/Structured-logging-of-data-structures_PR branch 2 times, most recently from 455bd47 to 210185f Compare September 17, 2018 09:02
@365andreas 365andreas requested a review from erikd September 17, 2018 09:34
@365andreas 365andreas changed the title Structured logging of data structures CBR-423 Structured logging of data structures Sep 17, 2018
@365andreas 365andreas changed the title CBR-423 Structured logging of data structures [CBR-423] Structured logging of data structures Sep 17, 2018
Copy link
Member

@erikd erikd left a comment

Choose a reason for hiding this comment

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

Seems legit!

@@ -8,3 +8,9 @@ loggerTree:
files:
- {{file}}.pub
Copy link
Contributor

Choose a reason for hiding this comment

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

we can actually remove the *.pub file as the JSON log will replace it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

<*> pure ((K._logEnvApp le) <> ns)
<*> pure loc
let lhs = cfg ^. lcLoggerTree ^. ltHandlers ^.. each
forM_ (filterJson lhs) (\ lh -> do
Copy link
Contributor

Choose a reason for hiding this comment

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

here we should test for _ltMinSeverity and only enter the message in the queues if its severity is greater or equal.
(see PR #3613)

@365andreas 365andreas force-pushed the andreas/CBR-423/Structured-logging-of-data-structures_PR branch 6 times, most recently from ad48f1c to 6ffb31f Compare September 19, 2018 15:20
@365andreas 365andreas force-pushed the andreas/CBR-423/Structured-logging-of-data-structures_PR branch 2 times, most recently from 3787bde to 5acaee7 Compare September 20, 2018 16:29
@365andreas
Copy link
Contributor Author

@erikd one last commit added and rebased again

@CodiePP CodiePP force-pushed the andreas/CBR-423/Structured-logging-of-data-structures_PR branch from 5acaee7 to 21baa09 Compare September 24, 2018 07:07
@CodiePP
Copy link
Contributor

CodiePP commented Sep 24, 2018

  • a new demo structure in the test Test.Pos.Util.LogStructuredSpec
  • removed ToJSON instances of LoggerConfig (not used anywhere)
  • rebased on develop

@365andreas 365andreas force-pushed the andreas/CBR-423/Structured-logging-of-data-structures_PR branch from 21baa09 to 401ef9f Compare September 26, 2018 12:01
@365andreas 365andreas force-pushed the andreas/CBR-423/Structured-logging-of-data-structures_PR branch from 401ef9f to 090a16a Compare September 26, 2018 15:29
@CodiePP CodiePP merged commit d86c311 into develop Sep 26, 2018
@365andreas 365andreas deleted the andreas/CBR-423/Structured-logging-of-data-structures_PR branch September 28, 2018 12:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants