Philippus commented on code in PR #2805:
URL: https://github.com/apache/pekko/pull/2805#discussion_r3008082840
##########
stream/src/main/scala/org/apache/pekko/stream/Attributes.scala:
##########
@@ -720,6 +722,23 @@ object Attributes {
/** Use to enable logging at DEBUG level for certain operations when
configuring [[Attributes#logLevels]] */
final val Debug: Logging.LogLevel = Logging.DebugLevel
+
+ /** INTERNAL API */
+ @InternalApi
+ private[pekko] def defaultErrorLevel(system: ActorSystem):
Logging.LogLevel =
+
fromString(system.settings.config.getString("pekko.stream.materializer.stage-errors-default-log-level"))
+
+ /** INTERNAL API */
+ @InternalApi
+ private[pekko] def fromString(str: String): Logging.LogLevel = {
+ Helpers.toRootLowerCase(str) match {
+ case "off" => Off
+ case "error" => Error
+ case "warning" => Warning
+ case "info" => Info
+ case "debug" => Debug
+ }
+ }
Review Comment:
This looks a bit dangerous if folks make typos in the config. Also, there's
already a `Logging.levelFor(s: String` method which does almost exactly the
same.
Maybe we could change this section to:
```
Logging.levelFor(
system.settings.config.getString("pekko.stream.materializer.stage-errors-default-log-level")).getOrElse(
Logging.ErrorLevel)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]