Add functionality to use a custom log handler#642
Add functionality to use a custom log handler#642hdijkema wants to merge 0 commit intowebui-dev:mainfrom
Conversation
|
I totally see the point here, but I'm wondering if this is necessary, especially the fact that all other wrappers need to implement this new API and will be available only in Please let me know if I miss something. |
|
Well, I've been debugging quite a lot to see what's going on and why some events work and some not in what circumstances. This is while working on a Web application. E.g., why don't I get a 'move' event, or how is it possible I don't get a navigation event. Or why does GtkWebView crash? Or to understand why things "lock up". Without the debug information that's a stretch to do. Look e.g. at programs like rsync, openvpn, etc. they all have a flexible logging system with more or less detailed information about what's going on under the hood. It's a good practice, especially to understand the behaviour of the software. In larger software projects people tend to create some logging functionality, e.g. Log4j, log4c. Also lots of programs log to syslog, or trace to a file. Of course one could redirect stdout and stderr to a file, but this is not always easy to do. E.g. my IDE catches stderr/out and the library output (of webui) just "disappears". I think this code is not intrusive, i.e. when no log handler is installed, it will just log to stdout/stderr. And when one chooses to install a log handler, it will redirect logging to the handler. Even if someone chooses not to implement the call to the log handler installer for a wrapper, it's not really a problem. But someone might choose to implement it, because of the reasons above. In the end, it's your project, so the decision is yours to make. |
|
Fair enough @hdijkema, I was just trying to make minimal change as possible in |
|
Ai. I'll try to resolve the conflicts, otherwise all discard this pull request and make another. |
0703905 to
80f8976
Compare
Add functionality to use a custom log handler, which facilitates
the integration of webui in software. Debug logging of webui
can now be integrated in logging systems of software that uses webui.