Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. // Quick and easy
  2. // add correlation id to app logs
  3. // set correlation id in test steps (but ignore user-specified correlation id in production)
  4.  
  5. log.anonymised({some:"log"});
  6.  
  7. log.sensitive(() => {some:"log"});
  8. log.sensitive({some:"log"});
  9.  
  10. // Maybe inconvenient, and maybe we don't need it
  11. // Stateful thread locals would be better, but hey ho
  12. const block = log.block("some block")
  13. const subblock = block.block("some sub-block")
  14.  
  15. {
  16. rootId: 1, // in Log, from request scope
  17. parentId: 1, // created by block()
  18. id: 1, // automatic
  19. }
  20.  
  21. {
  22. rootId: 1, // in Log, from request scope
  23. parentId: 1, // created by block()
  24. id: 2, // automatic
  25. type: "block",
  26. message: "some title"
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement