daa84 / neovim-gtk

gtk ui for neovim
GNU General Public License v3.0
716 stars 57 forks source link

Use `error!`/`warn!` logs instead of `println!` #84

Closed idanarye closed 6 years ago

idanarye commented 6 years ago

Writing to stdout will panic if the pipe is broken. This can happen, for example, if you run (in Linux):

nvim-gtk & exit

Then repeatedly hit <Tab> to make it print Event bell([]) to the (already closed) STDOUT. After a few tabs it'll crash - because it is trying to write to a broken pipe.

The macros from the log crate don't crash when the pipe is broken. It also makes more sense to use them, since these prints are not the actual output of the application.

daa84 commented 6 years ago

Thank you