akka / akka/akka-http

DebuggingDirectives should not toString() if log level not enabled

Open
#82 2 comments 0 reactions 0 assignees View on GitHub
1 - triaged
Dominant language
Scala
Stars
1.4k
Forks
584
Avg merge
14h 33m
Merged PRs (30d)
24

Description

**Issue by [jypma](https://github.com/jypma)**
_Monday Feb 29, 2016 at 14:03 GMT_
_Originally opened as https://github.com/akka/akka/issues/19914_

---

The `log*` directives in `DebuggingDirectives` right now always invoke the `LoggingMagnet`'s function, which in turn always operates on a `LogEntry` case class that just `toString`s its argument.

We should only `toString` (and preferably only invoke any custom "show" closures) when the log level is actually enabled. This could be done inside the `LogEntry` class, or maybe in the directives themselves.

Contributor guide

Open the contributing guide

Research direction

Start with the DebuggingDirectives log* directives and trace their use of LoggingMagnet and the LogEntry case class. Verify that argument stringification and custom show closures are deferred when the configured log level is disabled, while enabled logging keeps its current behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.