Skip to content

Commit

Permalink
feat(contributing): logging
Browse files Browse the repository at this point in the history
  • Loading branch information
ten3roberts committed Jul 17, 2023
1 parent 2cb6e6b commit 9a5e36a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,21 @@ Simply clone *Neogit* to your project directory of choice to be able to use your
[`lazy-spec`](https://github.com/folke/lazy.nvim#-plugin-spec) and
[`lazy-configuration`](https://github.com/folke/lazy.nvim#%EF%B8%8F-configuration) for details.

### Logging

Logging is a useful tool for inspecting what happens in the code and in what order. Neogit uses
[`Plenary`](https://github.com/nvim-lua/plenary.nvim) for logging.

Export the environment variables `NEOGIT_LOG_CONSOLE="sync"` to enable logging, and `NEOGIT_LOG_LEVEL="debug"` for more
verbose logging.

```lua
local logger = require("neogit.logger")

logger.fmt_info("This is a log message: %d", 2)
logger.fmt_debug("This is a verbose log message: %q", status)
```

## Code Standards

### Testing
Expand Down

0 comments on commit 9a5e36a

Please sign in to comment.