Giter Club home page Giter Club logo

Comments (2)

ijpiantanida avatar ijpiantanida commented on June 19, 2024 1

Great call @scmx, the global logger was definitely a problem.

This should be fixed in v3.0.2

from talkback.

scmx avatar scmx commented on June 19, 2024

I have run into the same thing. I use multiple talkback.requestHandler.

The problem seems to be that for every time a new requestHandler or server is created there is a line initializeLogger

initializeLogger(fullOptions)
return new TalkbackServer(fullOptions)
}
static async requestHandler(options: Partial<Options>) {
const fullOptions = Options.prepare(options)
initializeLogger(fullOptions)

which modifies a global logger object to override logger.log with an instance of ConsoleLogger instead of NoopLogger.
logger.log = new ConsoleLogger(options)
and passes in the options of the current handler! So the logger becomes tied to the current handler.

The logger has a method formatMessage that takes only two arguments message and level. I have been overriding formatMessage myself to tweak its output, but I didn't understand why it printed for the wrong handler.

When formatMessage is called there is nothing to differentiate between different handlers so it is not enough to patch it.

from talkback.

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.