2

I want slf4j NOP implementation to log to the console. Currently, it just doesnt log anything, instead is there a way to have it log to the console?

My use case is I have a library (not an app) which just depends on slf4j-api. But some of the classes in there have main method for testing purposes. When I run those main methods, I want all the logs to go to the console without having to depend on slf4j-log4j binding.

Thanks.

Sitansu
  • 3,225
  • 8
  • 34
  • 61
Neha
  • 71
  • 2
  • 11

2 Answers2

5

NOP means "no operation". Its purpose is not to do anything and thus not log anything.

Guillaume
  • 5,535
  • 1
  • 24
  • 30
  • Thanks. I read something which led me to believe that probably NOP could log to console too, but I must have misunderstood. – Neha Dec 27 '13 at 18:41
4

You could use the slf4j-simple implementation. It will log to the console.

Henry
  • 42,982
  • 7
  • 68
  • 84
  • Thanks. Yes, I do realize that but was confused by something I read which led me to believe that probably NOP could log to console too. – Neha Dec 27 '13 at 18:41