typelevel / log4cats

Logging Tools For Interaction with cats-effect
https://typelevel.org/log4cats/
Apache License 2.0
398 stars 73 forks source link

Implement a Scala.js `ConsoleLogger` #680

Closed armanbilge closed 1 year ago

armanbilge commented 1 year ago

There's currently no "default" logging backend for Scala.js, but it should be easy to add one based on the JavaScript console APIs. Technically console is not part of core JavaScript, but it is specced and is fairly standard across Node.js and browsers.

I'm not a maintainer on this repo so if someone works on this or has questions please make sure to ping me :)

armanbilge commented 1 year ago

Here's a partial facade for the console APIs. We should inline it instead of adding a dependency to scala-js-dom because that dependency makes sense only for browsers.

https://github.com/scala-js/scala-js-dom/blob/51a807cc04ea134ece030d6d4005a8ce30c1de99/dom/src/main/scala/org/scalajs/dom/Console.scala

2chilled commented 1 year ago

@danicheg It seems like there is no release including this functionality available yet. Can we change that? Would be great!

armanbilge commented 1 year ago

Yes, I'd love a release with this too. Until then, there is a snapshot. https://s01.oss.sonatype.org/content/repositories/snapshots/org/typelevel/log4cats-js-console_sjs1_3/2.5.0-99-e87a0cd-SNAPSHOT/

rossabaker commented 1 year ago

I just created a 3.6.0 milestone with the things that are almost ready, and we can get a new release.