Skip to content

Add a ConsoleLogger and ConsoleLoggerFactory #912

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

morgen-peschke
Copy link
Contributor

Implements #911

If there's interest, I'll figure out how to add some tests to this.

* limitations under the License.
*/

package org.typelevel.log4cats.extras
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danicheg following up on if the rename to StdErrLogger works for you as a disambiguation with the JS ConsoleLogger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants