Add a ConsoleLogger and ConsoleLoggerFactory#912
Add a ConsoleLogger and ConsoleLoggerFactory#912morgen-peschke wants to merge 9 commits intotypelevel:mainfrom
Conversation
core/shared/src/main/scala/org/typelevel/log4cats/extras/ConsoleLogger.scala
Outdated
Show resolved
Hide resolved
core/shared/src/main/scala/org/typelevel/log4cats/extras/ConsoleLogger.scala
Outdated
Show resolved
Hide resolved
| * limitations under the License. | ||
| */ | ||
|
|
||
| package org.typelevel.log4cats.extras |
There was a problem hiding this comment.
We already have the dedicated js-console module that exposes ConsoleLogger for JS. Shouldn't we either create a new module for JVM/Native to maintain consistency (perhaps extras would be fine), or at the very least move the new ConsoleLogger to a JVM/Native-specific submodule, so it's only published for the mentioned platforms?
There was a problem hiding this comment.
I don't really have the setup, but I'm kind of curious what this would do in JS. I'd assume that Console has an implementation on that platform 🤔
It's all going on stderr, so I'd be open to renaming it StdErrLogger to avoid confusion.
There was a problem hiding this comment.
I thought part of the goal was to have this available in core, without depending on other modules? Otherwise, I'd think we'd just use slf4j and slf4j-simple?
There was a problem hiding this comment.
That is a core motivation - make it dead simple to use out-of-the-box, and avoid requiring users who don't need heavy configuration (like scastie examples or scripts) to remember the artifact coordinates for the stuff to make slf4j-simple work.
There was a problem hiding this comment.
@danicheg following up on if the rename to StdErrLogger works for you as a disambiguation with the JS ConsoleLogger
|
ping @danicheg and @rossabaker |
Implements #911
If there's interest, I'll figure out how to add some tests to this.