Skip to content
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

Introduce logging #22

Open
ntnn opened this issue Nov 1, 2016 · 6 comments
Open

Introduce logging #22

ntnn opened this issue Nov 1, 2016 · 6 comments
Assignees
Milestone

Comments

@ntnn
Copy link
Collaborator

ntnn commented Nov 1, 2016

Introduce logging

Soft-touched logging would be nice, e.g. qf#log, qf#debug and
qf#error, which prefix the message with a vim-qf:level: and the
debug level only showing when e.g. g:qf_debug is true or the like.

This'd help greatly with debugging in the future as well as help
understand the code (e.g. on early returns etc.pp. a debug message would
act like a comment explaining the early exit.

@romainl romainl added this to the logging milestone Nov 2, 2016
@arecarn
Copy link

arecarn commented Nov 14, 2016

For some of of my scripts I've used Decho. It is definitely not perfect but it is pretty easy to start using.

@ntnn
Copy link
Collaborator Author

ntnn commented Nov 14, 2016

@romainl what do you think? Do you want external dependencies?
Another possibility would be to write our own logging library with
structured logging - though that might be a bit oversized for a bit of
scripting.

Sent with AquaMail for Android
http://www.aqua-mail.com

On 14 November 2016 5:55:47 pm Ryan Carney [email protected] wrote:

For some of of my scripts I've used
Decho. It is definitely not perfect
but it is pretty easy to start using.

You are receiving this because you were assigned.
Reply to this email directly or view it on GitHub:
#22 (comment)

romainl added a commit that referenced this issue Nov 14, 2016
@romainl
Copy link
Owner

romainl commented Nov 14, 2016

Silly me… that was #23.

@romainl
Copy link
Owner

romainl commented Nov 14, 2016

@ntnn I don't want external dependencies if I can avoid them. I'd like to play with :throw and friends before turning to a logging lib.

@arecarn
Copy link

arecarn commented Nov 14, 2016

A real vimscript logging library would be very nice, I could never seem find one.

Once potentially nice thing about Decho is that it is only a dependency for anyone who wants to use logging. In my case I just enabled it for debugging and disabled it before committing changes or fixes.

@ntnn
Copy link
Collaborator Author

ntnn commented Nov 14, 2016

No, having a difference in the code between dev and production is not a choice.
I'd rather use a stub file which defines the functions as noops if the logging plugin is not loaded.

@romainl Mhm... I don't like exceptions, I'd rather sanitize input more.
A properly written logging library would be nice, on the other hand simple logging would be just a case of using a s:log function and qf#error, qf#debug and qf#info, wrapping the s:log. Those three levels should be sufficient for most use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants