apache / apache/pekko

LoggingAdapter with ActorSystem and class broken in scala 3

Open
#1,538 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Scala
Stars
1.6k
Forks
211
Avg merge
1d 6h
Merged PRs (30d)
89

Description

when migrating from scala `2.13.14` to scala `3.3.0` we're running into an error with the LoggingAdapter.
The setup:
```scala
package com.example

import org.apache.pekko.actor.ActorSystem
import org.apache.pekko.event.{Logging, LogSource, LoggingAdapter}

class Foo(actorSystem: ActorSystem) {
val bar: LoggingAdapter = Logging(actorSystem, getClass)
}
```
does compile with scala `2.13.14` but with scala `3.3.0` it runs into the following Error:
```
Cannot find LogSource for Class[? <: com.example.Foo] please see ScalaDoc for LogSource for how to obtain or construct one..
I found:

org.apache.pekko.event.LogSource.fromAnyClass[T]

But method fromAnyClass in object LogSource does not match type org.apache.pekko.event.LogSource[Class[? <: com.example.Foo]].
val bar: LoggingAdapter = Logging(actorSystem, getClass)
```

pekko version used is `1.1.2`

if this is not a bug and only an error on my side im sorry but i have not found anything on this topic in the docs

Contributor guide

Open the contributing guide

Research direction

Use the minimal Foo reproducer in the issue as the starting point, focusing on Logging(actorSystem, getClass), LoggingAdapter, and LogSource. Compare the Scala 2.13.14 and Scala 3.3.0 behavior and consult the LogSource documentation referenced by the compiler. Done means the reported Scala 3 case is fixed or its supported usage is clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
distributed-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.