Skip to content

wsdjeg/logger.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logger.nvim

logger.nvim is a simple runtime logger plugin for Neovim.

Installation

Using nvim-plug:

require('plug').add({
  {
    'wsdjeg/logger.nvim',
    config = function()
      require('logger').setup({})
    end,
  },
})

Setup

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:
local logger = require('logger')

logger.info('this is default log')

the output of logger.viewRuntimeLog()

[ logger ] [23:22:50:576] [ Info  ] hello world

  1. derive a new logger with plugin name:
local logger = require('logger').derive('name')

logger.info('hello world')

the output of logger.viewRuntimeLog()

[   name ] [23:22:50:576] [ Info  ] hello world

Self-Promotion

Like this plugin? Star the repository on GitHub.

Love this plugin? Follow me on GitHub and Twitter.

License

This project is licensed under the GPL-3.0 License.

About

Neovim runtime logger

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages