graphql-engine/server
Gil Mizrahi 904029aa7d Add fancier trace debugging functions to Hasura.Prelude
## 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
2021-08-12 19:33:56 +00:00
..
bench-wrk server: generalize integration tests 2021-03-11 18:18:41 +00:00
benchmarks server benchmarks: minor fixup of afbdb8d74 2021-08-09 19:28:47 +00:00
packaging MySQL: Add mysql-client dependencies on CI and in .cabal file 2021-07-12 20:07:46 +00:00
src-exec Revert "Disable TLS checks for actions services with self-signed certificates" 2021-08-06 17:06:55 +00:00
src-lib Add fancier trace debugging functions to Hasura.Prelude 2021-08-12 19:33:56 +00:00
src-rsr tag release v2.0.6 2021-08-11 01:19:22 +00:00
src-test Fix telemetry unit test by sorting before comparing 2021-08-11 15:36:30 +00:00
tests-py server/bigquery: run tests in CI 2021-08-12 16:48:29 +00:00
.dockerignore update packages (#251) 2018-08-08 13:10:13 +05:30
.gitignore server/citus: feature branch 2021-05-21 02:47:51 +00:00
.hlint.yaml ci: improve hlint messages 2021-05-04 21:52:55 +00:00
.stylish-haskell.yaml ci: run stylish haskell on all incoming PRs 2021-01-21 23:37:26 +00:00
cabal.project.ci update resource limits on circleci [force ci] 2021-01-29 14:36:07 +00:00
commit_diff.txt Rewrite GraphQL schema generation and query parsing (close #2801) (#4111) 2020-08-21 12:27:01 -05:00
CONTRIBUTING.md server/bigquery: run tests in CI 2021-08-12 16:48:29 +00:00
graphql-engine.cabal Add fancier trace debugging functions to Hasura.Prelude 2021-08-12 19:33:56 +00:00
Makefile Combine oss and pro server configuration 2021-08-11 04:19:27 +00:00
Setup.hs move raven into graphql-engine repo 2018-06-28 00:32:00 +05:30
STYLE.md server: Add a Haskell style guide (#2175) 2020-04-08 02:31:30 -05:00