Coder Social home page Coder Social logo

Switchable Logger about comedy HOT 8 CLOSED

untu avatar untu commented on May 21, 2024
Switchable Logger

from comedy.

Comments (8)

aintnorest avatar aintnorest commented on May 21, 2024 1

looks great thanks.

from comedy.

weekens avatar weekens commented on May 21, 2024

There is some work needed to be put in order to make this work, but I think it's a matter of couple of days. I was expecting this kind of request. Will try to do in nearest time.

from comedy.

weekens avatar weekens commented on May 21, 2024

Added support for custom loggers in v1.8.0. See example: https://github.com/untu/comedy-examples/blob/master/custom-logger-bunyan.js

from comedy.

aintnorest avatar aintnorest commented on May 21, 2024

I used your example and it worked great until I tried starting an actor in forked mode. I then got Error: Cannot serialize actor definition. I threw a console in and noticed it was the BunyanLoggerAdapter. I made sure to move all the requires into the class itself but that didn't seem to help so I switched it to use the module method of loading. That worked but with two problems. I now get a warning for:
Promise.defer is deprecated and will be removed in a future version. Use new Promise instead.
a lot and my second problem is I'm not sure how to pass in a name for the bunyan initialization.

from comedy.

weekens avatar weekens commented on May 21, 2024

I will look at Promise.defer warnings.

As for logger name: in the example it was hard-coded into BunyanLoggerAdapter. Clearly, this may be not what you want. My question is: how would you like this to be done instead?

from comedy.

aintnorest avatar aintnorest commented on May 21, 2024

Maybe a way to pass in customParameters as part of the configuration.

from comedy.

weekens avatar weekens commented on May 21, 2024

@aintnorest , I've implemented constructor parameters for custom logger. Please check forked-bunyan-logger branch from comedy-examples repo together with custom-logger-params branch from this repo and tell if it works for you.

As for Promise.defer error - I could not reproduce it in forked-bunyan-logger branch in examples even with current Comedy release. Please try that example with release version and tell if you are able to see Promise.defer errors. If not, please send me your code example.

from comedy.

weekens avatar weekens commented on May 21, 2024

Fix released in v.2.1.0.

from comedy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.