ahmetaa / zemberek-nlp

NLP tools for Turkish.
Other
1.14k stars 207 forks source link

Issues with logging class #222

Open mrmutator opened 5 years ago

mrmutator commented 5 years ago

The class zemberek.core.logging.Log is a bit aggressive that makes it difficult to use Zemberek in other environments, e.g. in a web server.

In particular, it registers a console logger, it registers JVM shutdown hooks and it overwrites the JVM uncaught exception handler. The last point is particularly aggressive and should be avoided in a library that is called from other projects.

Ideally, the actions mentioned above should be moved into a separate init() method that could be called if necessary. Similarly, there should be a shutdown method that undoes those actions.

ahmetaa commented 5 years ago

I agree that it is too aggressive. I wrote Zemberek logger because I wanted something simple but it went out of control for some time. Perhaps using a mainstream logger might have been a better choice but as it was used in so many places I did not bother. Actually removing JVM uncaught exception handler is fine for me, I would be glad if you send a pull request. If you cant, I will handle it later.