typelevel / typelevel/log4cats

Way to change loglevel locally / globally?

Open
#748 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Scala
Stars
416
Forks
77
Avg merge
6h 25m
Merged PRs (30d)
3

Description

It may be useful if we can change loglevel in scope like: logger.withLoglevel("DEBUG"). Defining it as IO[Resource[IO, Unit]] enables us to change and revert loglevel simply.

Currently I'm calling System.setProperty("org.slf4j.simpleLogger.log.FooClass","DEBUG").

Thanks.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the proposed logger.withLoglevel("DEBUG") API and the current System.setProperty workaround described in the issue. Define what scoped and global changes should mean, how IO[Resource[IO, Unit]] should restore the previous level, and what tests would demonstrate both behaviors.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
observability
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.