TrueBitFoundation / truebit-os

[DEPRECATED] Interactive client
Apache License 2.0
82 stars 26 forks source link

Add simple logger #15

Closed OR13 closed 6 years ago

OR13 commented 6 years ago

Here is a simple example of logging with both console and file support with winston. If this approach is sound, I can add logging for the rest of the os test.

I also tried to clean the npm dependencies, but encountered errors with the build cache, sorry for mixing that in here, still got rid of some of them.

hswick commented 6 years ago

This looks good, winston seems like the right approach.

Few comments:

1) You can move the logger test into the test/os.js test if you want 2) Remove the semicolons please lol :p

OR13 commented 6 years ago

cool, will do.

OR13 commented 6 years ago

nice to know that logging errors don't cause the tests to fail...

OR13 commented 6 years ago

Sorry for committing whitespace to get the build to pass...

builds that fail with this:

$ npm i -g ganache-cli truffle
npm ERR! code E429
npm ERR! 429 Too Many Requests: ganache-cli@latest

Can be restarted, and will probably not error in the same way.

OR13 commented 6 years ago

This is ready for review. I'm happy to add more logging, but figured it would be better to start off light.

hswick commented 6 years ago

Great! Keeping it light for now is okay, I've been fixing a bunch of bugs on my end so this will make it easier to merge.

Hopefully, I should have that done by today, and then we can go in and add more logging.