简体   繁体   中英

How to get Spec file logs withoug using ActorLogging

I have test file like this

class SomeSpec extends Specification with Specs2RouteTest with SomeService

where I have written test cases, its workiing fine.

But I am not able to get log messages in log file, so I need to have logging in that spec, now we can do this by using

class SomeSpec extends Specification with Specs2RouteTest with 
SomeService with ActorLogging with Actor 

my problem is I dont want to use akka.actor.ActorLogging without using it, I want to get logs of specss in log file, so can you suggest some other way for it.

Just use a non-Akaa logging library like Scala Logging .

It provides several mixins so you can do something like:

class SomeSpec extends Specification with Specs2RouteTest with SomeService with LazyLogging {
  logger.debug("This is very convenient ;-)")
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM