-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Maktaba should offer a simple log handler #141
Comments
You can get it with two hacky lines of vimscript: let g:maktaba_log = []
call maktaba#log#AddHandler(maktaba#function#FromExpr('add(g:maktaba_log, a:000)'), 1) The real answer is to publish a simple plugin to receive and display the logs. We can document that hack to get it in the meantime, or maybe we could add something like let g:maktaba_log = maktaba#log#NewReceiverList(1) I don't think bounding it will be that big a deal either, at least for the short-term solution. |
A logging plugin would certainly be nice, but I was thinking of something that would be available to someone just using Maktaba. I like the idea of providing something simple. I think what you're proposing with Is there any reason a casual caller wouldn't want the recent log entries? |
Almost. The list reference would be updated as new messages come in. But actually, something like BTW, don't want to optimize for the no-logging-plugin case too much, because reading entries from a vimscript list is pretty awkward and the plugin is very small. We thought about including more of a user interface in maktaba but it didn't fit well for a library. |
I also noticed maktaba doesn't shout warning and error logging to the user as messages come in (#185). That part should be pretty easy to make built-in. |
Maktaba's logging is useful, but unless I'm missing something, there's easy no way to use it out of the box, as you need your own log handler before it'll do anything.
We don't want to install a log handler by default, but it would be useful to provide an optional
maktaba#log#InstallSimpleLogHandler()
that adds a handler that accumulates log records into a (user-specified?) limited-size list, along with amaktaba#log#GetSimpleLogHandlerRecords()
or similar.The text was updated successfully, but these errors were encountered: