github.com/bookerzzz/grok@v0.0.0/README.md (about)

     1  # Grok it like you mean it!
     2  
     3  Tired of debugging using the same old `fmt.Println` and `fmt.Printf("%+v", var)`. Enter `grok`! A new package to help you grok your own code.
     4  
     5  ## Install:
     6  ```sh
     7  go get github.com/bookerzzz/grok
     8  ```
     9  
    10  ## Usage:
    11  
    12  ```go
    13  import "github.com/bookerzzz/grok"
    14  
    15  fake := "News"
    16  
    17  grok.Value(fake) // or grok.V(fake)
    18  
    19  // or for customised output
    20  
    21  grok.Value(fake, ...grok.Option)
    22  ```
    23  
    24  The grok package comes with the following customisation options baked in:
    25   
    26  ```go
    27  // WithWriter redirects output from debug functions to the given io.Writer
    28  func WithWriter(w io.Writer) Option
    29  ```
    30  ```go
    31  // WithoutColours disables colouring of output from debug functions. Defaults to `true`
    32  func WithoutColours() Option
    33  ```
    34  ```go
    35  // WithMaxDepth sets the maximum recursion depth from debug functions. Defaults to `10`, use `0` for unlimited
    36  func WithMaxDepth(depth int) Option 
    37  ```
    38  ```go
    39  // WithMaxLength sets the maximum length of string values. Default is `100`, use `0` for unlimited
    40  func WithMaxLength(chars int) Option
    41  ```
    42  ```go
    43  // WithTabStop sets the width of a tabstop to the given char count. Defaults to `4`
    44  func WithTabStop(chars int) Option
    45  ```
    46  
    47  ## Got 99 problems and this code is one?
    48  
    49  Please create an [issue](https://github.com/bookerzzz/grok/issues)