mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 17:31:56 +03:00
904029aa7d
## Suggestion: Add fancier trace debugging functions to `Hasura.Prelude` This PR adds two trace functions, `ltrace` and `ltraceM`, which use the `pretty-simple` package to `show` the input with nice formatting and colors for ease of reading (and comparing using diff tools such as `meld` or `vim-diff`). I've also added warning pragmas to the functions, which means: 1. Traces will not be left in code, as CI builds with -Werror 2. Developers will have to change the `ghc-options` to `-Wwarn` in their `cabal.project.local` settings to use these functions ### Example Usage: ```hs selectFunctionAggregate ... = ... do ltraceM "functionInfo" function ... ``` Output to terminal looks like this: <img width="524" alt="Screen Shot 2021-08-12 at 10 33 24" src="https://user-images.githubusercontent.com/8547573/129158878-4a5e96ba-30a5-452c-8f33-9eb4b2cc5e2a.png"> ### Dependencies Requires adding the following dependencies: - prettyprinter-ansi-terminal-1.1.2 (BSD2) - pretty-simple-4.0.0.0 (BSD3) Question: what is the process for adding new dependencies? How does decisions on this matter happen? https://github.com/hasura/graphql-engine-mono/pull/2075 GitOrigin-RevId: 490b0f0ca595da319b43e92e190ba50c0b132cd5 |
||
---|---|---|
.. | ||
bench-wrk | ||
benchmarks | ||
packaging | ||
src-exec | ||
src-lib | ||
src-rsr | ||
src-test | ||
tests-py | ||
.dockerignore | ||
.gitignore | ||
.hlint.yaml | ||
.stylish-haskell.yaml | ||
cabal.project.ci | ||
commit_diff.txt | ||
CONTRIBUTING.md | ||
graphql-engine.cabal | ||
Makefile | ||
Setup.hs | ||
STYLE.md |