Giter Club home page Giter Club logo

Comments (5)

megastef avatar megastef commented on May 27, 2024

Well, why dont you pass a new object with the relevant fields to winston? Putting just your current js object could also trouble with elasticsearch mappings. Imagine an 'id' field, one time as string next as integer - indexing would fail. Anyhow, we could look into an option to clone objects (bad for performance) or check where objects are modified to switch it off.

from winston-logsene.

libor-vilimek avatar libor-vilimek commented on May 27, 2024

Well I personally do it everywhere, therefore my code cause no troubles, but we have a thousands of lines of code from past which we did not write. And after changing logging service, our application stars falling, which I personally think should not happen (services we used before do not change the object we are using).

Having option for just "not send any extra field" like "source" is good enough for us, we do not need it.

However I am just thinking - do you use "toJSON" method? Then all you need is to append things like "source" to object which is created by it, not before. Or do you have another approach?

from winston-logsene.

megastef avatar megastef commented on May 27, 2024

Looked into the code. There is a rewrite option in the constructor - a function that can create a new object.
Actually the only field, which is added is "source", so we can switch that off with an option "setSource: false". How does it sound to you? For moment I would not make it standard, as other user might like the feature that that the node module is added to the log.

from winston-logsene.

libor-vilimek avatar libor-vilimek commented on May 27, 2024

That sounds great, I agree with "not stantard yet" beacuse it can cause troubles for users which is already using it. However if I would be you, I would think about "deprecate" that in future and after some time switch it, because IMHO logger should not cause any potential modifications by default.

from winston-logsene.

megastef avatar megastef commented on May 27, 2024

Just published a new version 1.1.10, setSource: false is default and the log event should not be modified (but could using the rewrite function in constructor ...)
The new option is in the Readme, so if somebody likes the old functionality, it can be added to the constructor.

from winston-logsene.

Related Issues (15)

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.