Code Monkey home page Code Monkey logo

Comments (4)

xianliy avatar xianliy commented on June 11, 2024 2

from signale.

IRegiani avatar IRegiani commented on June 11, 2024 1

Don't know if that is still going to be helpfull, but you can pass on the options the default stream (process.stderr) and a writableStream to a file:
const logger = new Signale({ stream: [process.stderr, fs.createWriteStream('./log.txt')] })

I haven't yet tested if writing to a file degrades the performance somehow, but as it is a writeStream I wouldn't expect any major impact. Also, the file will receive the buffer converted to UTF-8, meaning that the control characters and color codes used to colorize the terminal output are going to appear in the file (eg: �[90m [39m). I was able to remove them by creating a wrapper and removing them using the control character (U+001B, 27 in decimal) before passing the stream to Signale, not sure if that is a good way to do it, but worked.

from signale.

Ccj-pro avatar Ccj-pro commented on June 11, 2024

I have the same problem.

from signale.

wout-junius avatar wout-junius commented on June 11, 2024

So how did you manage to create the wrapper befor passing the stream. i am no clear on how it is done in code?
Could you mayby give an example?

from signale.

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.