diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2021-08-16 13:56:38 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2021-08-16 13:58:05 +0200 |
| commit | bcab92186e8bd66e6841f33275d261af00e43a25 (patch) | |
| tree | 51ba4bd5ef6a9256cba756d8d6667f8984721c8c /init.lua | |
| parent | 85e8aced46fecc5acbdf96bac5dc3af6217ba16e (diff) | |
| download | vis-lspc-bcab92186e8bd66e6841f33275d261af00e43a25.tar.gz vis-lspc-bcab92186e8bd66e6841f33275d261af00e43a25.zip | |
write errors and warnings to the log
Diffstat (limited to 'init.lua')
| -rw-r--r-- | init.lua | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -1,12 +1,20 @@ -- Copyright (c) 2021 Florian Fischer. All rights reserved. -- Use of this source code is governed by a MIT license found in the LICENSE file. -- We require vis compiled with the communicate patch + +-- forward declaration of our client table +local lspc + local function lspc_warn(msg) - vis:info('LSPC Warning: ' .. msg) + local warning = 'LSPC Warning: ' .. msg + lspc.log(warning) + vis:info(warning) end local function lspc_err(msg) - vis:info('LSPC Error: ' .. msg) + local err = 'LSPC Error: ' .. msg + lspc.log(err) + vis:info(err) end if not vis.communicate then @@ -70,9 +78,6 @@ do end assert(vis_pid) --- forward declaration of our client table -local lspc - -- logging system -- if lspc.logging is set to true the first call to lspc.log -- will open the log file and replace lspc.log with the actual log function |
