I am trying to print an object that is passed to a class function in scala.
The case class is written:
config {
...
case class NetConfig(
domain: NetDomain,
prodDomain: NetDomain,
@ConfigName("base_url") baseUrl: BaseUrl,
@ConfigName("asset.domain") assetDomain: AssetDomain,
@ConfigName("asset.base_url") assetBaseUrl: AssetBaseUrl,
@ConfigName("asset.minified") minifiedAssets: Boolean,
@ConfigName("stage.banner") stageBanner: Boolean,
@ConfigName("socket.domains") socketDomains: List[String],
crawlable: Boolean,
@ConfigName("ratelimit") rateLimit: RateLimit,
email: EmailAddress
) {
def isProd = domain == prodDomain
}
...
}
The class function is written:
import ....config.NetConfig
final class CSRFRequestHandler(net: NetConfig) {
...
}
I'd like to see the values of all the members of NetConfig when this handler is called. I tried a few things like:
final class CSRFRequestHandler(net: NetConfig) {
println(NetConfig)
(I just got the word NetConfig)
or
println(NetCConfig.domain)
(got compile error value domain is not a member of object lila.common.config.NetConfig)
or NetConfig.show
(got the word NetConfig)
FYI we are using the Play framework. And I don't know scala sigh. What is the correct way to print all the values of NetConfig?