https://github.com/wsdjeg/logger.nvim
Neovim runtime logger
https://github.com/wsdjeg/logger.nvim
neovim-plugin
Last synced: 4 months ago
JSON representation
Neovim runtime logger
- Host: GitHub
- URL: https://github.com/wsdjeg/logger.nvim
- Owner: wsdjeg
- License: gpl-3.0
- Created: 2025-02-21T09:05:41.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-04-22T08:32:57.000Z (about 1 year ago)
- Last Synced: 2025-04-22T09:43:54.409Z (about 1 year ago)
- Topics: neovim-plugin
- Language: Lua
- Homepage:
- Size: 26.4 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# logger.nvim
`logger.nvim` is a simple runtime logger plugin for Neovim.
[](LICENSE)
[](https://github.com/wsdjeg/logger.nvim/issues)
[](https://github.com/wsdjeg/logger.nvim/commits/master/)
[](https://github.com/wsdjeg/logger.nvim/releases)
[](https://luarocks.org/modules/wsdjeg/logger.nvim)
- [Installation](#installation)
- [Setup](#setup)
- [Usage](#usage)
- [Self-Promotion](#self-promotion)
- [License](#license)
## Installation
Using [nvim-plug](https://github.com/wsdjeg/nvim-plug):
```lua
require('plug').add({
{
'wsdjeg/logger.nvim',
config = function()
require('logger').setup({})
end,
},
})
```
Using [luarocks](https://luarocks.org/)
```
luarocks install logger.nvim
```
## Setup
```lua
require('logger').setup({
-- the level only can be:
-- 0 : log debug, info, warn, error messages
-- 1 : log info, warn, error messages
-- 2 : log warn, error messages
-- 3 : log error messages
level = 0,
file = '~/.cache/nvim-log/log.txt',
})
```
## Usage
1. Use default logger:
```lua
local logger = require('logger')
logger.info('this is default log')
```
the output of `logger.viewRuntimeLog()`
```
[ logger ] [23:22:50:576] [ Info ] hello world
```
2. derive a new logger with plugin name:
```lua
local logger = require('logger').derive('name')
logger.info('hello world')
```
the output of `logger.viewRuntimeLog()`
```
[ name ] [23:22:50:576] [ Info ] hello world
```
3. clear runtime log
```lua
logger.clearRuntimeLog()
```
## Self-Promotion
Like this plugin? Star the repository on
GitHub.
Love this plugin? Follow [me](https://wsdjeg.net/) on
[GitHub](https://github.com/wsdjeg).
## License
This project is licensed under the GPL-3.0 License.