How to get Spec file logs withoug using ActorLogging

60 Views Asked by At

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.

1

There are 1 best solutions below

0
On

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 ;-)")
}