Skip to content

Move frontend logging to debug library. #193

Description

@hobofan

We have quite a lot of logging in the frontend, which is good, but we also don't have good filter mechanisms for selectively enabling logging. There are some parts for this in frontend/src/utils/debugLogger.ts, but I think it would be good to use an established library for that rather than building something ourselfes.

One commonly used library for doing that in the browser is debug. One example of a library using it is socket.io-client, which uses it like this:

import debugModule from "debug"; // debug()

const debug = debugModule("socket.io-client:url"); // debug()

debug("protocol-less url %s", uri);

It can then be selectively enabled like this in the browser console:

localStorage.debug = "socket.io-client:*";

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions