lloydmeta/schwatcher — pull request #21 by crdueck (2013-11-22 18:55:23+00:00)
Title: Logging

Currently, logging is being done in 4 places in the schwatcher library:

- CallbackActor (1)
- WatchServiceTask (4)
- MonitorActor (5)
- RecursiveFileActions (1)

The logging in `CallbackActor` is debug logging to catch any unknown messages. `CallbackActor` only receives messages (PerformCallback) from MonitorActor, so I think it's safe to drop this one.

`RecursiveFileActions` only logs if `forEachDir` is called on a file and just logs the error. In this case it might be appropriate to throw an `IllegalArgumentException`, since if a user is calling `forEachDir` on a file that is probably a big oversight and we should bring it to their attention with an exception. At the least, this logging is also safe to remove.

The logging in `WatchServiceTask` and `MonitorActor` is a bit more substantial, but doesn't report anything critical.

From my perspective as a user of schwatcher, I'd rather have the library perform no logging and let me log around the library as needed. As well, logging is adding 3 dependencies to this otherwise very lightweight library (logback-classic, scalalogging-slf4j, slf4j-api). I don't think the benefits from logging some debug messages is worth these extra dependencies.

Finally, I sometimes get this output from SLF4J when I start up my application:

SLF4J: The following loggers will not work because they were created
SLF4J: during the default configuration phase of the underlying logging system.
SLF4J: See also http://www.slf4j.org/codes.html#substituteLogger
SLF4J: com.beachape.filemanagement.MonitorActor

I'm not very familiar with SLF4J so I don't know what's causing this, or if there's an easy fix, but removing logging certainly prevents this from happening :)

I've attached a pull request that drops these logging dependencies and removes logging from the library. What do you think?