thegazelle-ad / gazelle-server

Server for front-end and editor tools of The Gazelle
MIT License
19 stars 8 forks source link

Add logger #362

Closed emilgoldsmith closed 6 years ago

emilgoldsmith commented 6 years ago

Resolves #332

Also snuck in a small change to the babel-jest .babelrc file as with our newest node version currently being used we don't need those transforms on tests anymore.

emilgoldsmith commented 6 years ago

Done with changes :).

I did a bit of research and really agree with this statement: screenshot from 2018-04-10 10-46-53

from this article.

So I did a more JS equivalent of a singleton where I never create a class as we can just create our instance directly, no need to bother with whether it gets instantiated several times as that's not allowed. The parts I didn't like before was especially the copying of the methods of an instance to the object, that was really ugly, and two things that shouldn't have been that tightly coupled, solved that now in a much nicer way I think :). Also before fatal was only returning a promise after it was initialized, now it's always async which is also a lot better

frederikbrinck commented 6 years ago

And that statement makes sense to me :)

emilgoldsmith commented 6 years ago

Awesome, I'll merge it in straight away then :)