{"id":18573324,"url":"https://github.com/huawenyu/vimlogger","last_synced_at":"2025-05-15T23:13:28.516Z","repository":{"id":79661009,"uuid":"81890596","full_name":"huawenyu/vimlogger","owner":"huawenyu","description":"Trace logging in viml","archived":false,"fork":false,"pushed_at":"2019-08-03T16:31:35.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-15T23:13:26.798Z","etag":null,"topics":["logger","vim"],"latest_commit_sha":null,"homepage":null,"language":"Vim script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/huawenyu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-14T01:29:29.000Z","updated_at":"2022-03-27T15:40:28.000Z","dependencies_parsed_at":"2023-05-14T07:30:49.136Z","dependency_job_id":null,"html_url":"https://github.com/huawenyu/vimlogger","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huawenyu%2Fvimlogger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huawenyu%2Fvimlogger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huawenyu%2Fvimlogger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huawenyu%2Fvimlogger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/huawenyu","download_url":"https://codeload.github.com/huawenyu/vimlogger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254436950,"owners_count":22070949,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["logger","vim"],"created_at":"2024-11-06T23:08:58.426Z","updated_at":"2025-05-15T23:13:28.496Z","avatar_url":"https://github.com/huawenyu.png","language":"Vim script","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vimlogger\nTrace logging in viml\n\n# Usage:\n```vim\n  \" in .vimrc\n  call logger#init('ALL', ['/dev/stdout', '/tmp/vim.log'])\n\n  \" in script\n  silent! let s:log = logger#getLogger(expand('\u003csfile\u003e:t'))\n\n  \" start logger\n  silent! call s:log.info('aaa')\n\n\n  $ tail -f /tmp/vim.log\n\n  [TRACE][20:42:46][gdb.vim] gdb: {\n      'ServerInit': function('confos#InitSvr'),\n      'Symbol': function('confos#Symbol'),\n      '_autorun': 0,\n      '_current_buf': -1,\n      '_current_line': -1,\n      '_gdb_break_qf': /tmp/gdb.break,\n      '_gdb_bt_qf': /tmp/gdb.bt,\n      '_has_breakpoints': 0,\n      '_initialized': 0,\n      '_jump_window': 1,\n      '_reconnect': 0,\n      '_server_addr': [10.1.1.125, 444],\n      '_server_exited': 0\n  }\n  [INFO][20:42:46][state.vim] Open gdb#SchemeCreate\n  [INFO][20:42:49][state.vim] matched: [, call, on_init]\n  [INFO][20:42:49][gdb.vim] Load breaks ...\n  [INFO][20:42:49][gdb.vim] Load set breaks ...\n  [INFO][20:42:49][gdb.vim] Gdbserver call Init()=function('confos#InitSvr')\n  [INFO][20:42:49][state.vim] matched: [, call, on_init]\n\n```\n\n\n# Function Reference:\n\n##  function logger#init(level, targets [, format [, filter]])\n```vim\n  @param level [String]\n    Log level.  One of 'ALL|TRACE|DEBUG|INFO|WARN|ERROR|FATAL|NONE'.\n  @param targets [mixed]\n    Output target.  Filename or Function or Dictionary or List of these\n    values.\n    Filename:\n      Log is appended to the file.\n    Function:\n      function Log(str)\n        echo a:str\n      endfunction\n    Dictionary:\n      let Log = {}\n      function Log.__call__(str)\n        echohl Error\n        echo a:str\n        echohl None\n      endfunction\n  @param format [String]\n    Log format.  {expr} is replaced by eval(expr).  For example, {getpid()}\n    is useful to detect session.  Following special variables are available.\n    {level}   log level like DEBUG, INFO, etc...\n    {name}    log name specified by logger#getLogger(name)\n    {msg}     log message\n    If this is 0, '', [] or {} (empty(format) is true), default is used.\n    default:  [{level}][{strftime(\"%Y-%m-%d %H:%M:%S\")}][{name}] {msg}\n  @param filter [mixed]\n    Pattern (String) or Function or Dictionary to filter log session.\n    Filter is applied to name that specified by logger#getLogger(name).  If\n    result is false, logging session do not output any text.\n    Pattern (String):\n      name =~ Pattern\n    Function:\n      function Filter(name)\n        return a:name == 'mylib'\n      endfunction\n    Dictionary:\n      let Filter = {}\n      let Filter.filter = ['alib', 'blib', 'clib']\n      function Filter.__call__(name)\n        return index(self.filter, a:name) != -1\n      endfunction\n  @return void\n```\n##  function logger#getLogger(name)\n```vim\n  @param name [String] Log name\n  @return Logger object\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuawenyu%2Fvimlogger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhuawenyu%2Fvimlogger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuawenyu%2Fvimlogger/lists"}