fosstodon.org is one of the many independent Mastodon servers you can use to participate in the fediverse.
Fosstodon is an invite only Mastodon instance that is open to those who are interested in technology; particularly free & open source software. If you wish to join, contact us for an invite.

Administered by:

Server stats:

11K
active users

#JavaScript & #TypeScript doesn't seem to have a decent #logging library. I looked around, but none of them fulfill all my needs.

• Creating loggers should be possible before configuring drivers/appenders/filters.

• The loggers should be divided into categories, and the categories should be hierarchically organized. For example, the drivers I set for the foo logger should also apply to the foo.bar and foo.bar.qux loggers.

• Multiple runtimes should be supported in addition to #Node.js, such as browsers, #Deno, #Bun, etc.

#log4js comes close to fulfilling the first two requirements, but does not fulfill the last one (runtime diversity).

Time for another yak shaving?

wraptile

@hongminhee I've used "tslog" before and it was alright. Though it didn't work with Deno or Bun few months ago. Maybe it's supported now.

@wraptile I also looked at tslog, but it doesn't support Deno. 😢

@hongminhee yeah logging sucks in JS. I miss Python's loguru every time I need to work in TS. Fortunately you can cobble up basic logger with the default console logging and a few classes to handle namespaces.