logwatcher icon indicating copy to clipboard operation
logwatcher copied to clipboard

Printing from library

Open lthiery opened this issue 3 years ago • 0 comments

https://github.com/aravindavk/logwatcher/blob/3ff858cef9dd50a2ac9a6715f5a62c7e64d2b39a/src/lib.rs#L68

I think a print in a library should generally be avoided. If you think you're user might care about a log rotation, you should have it be an event that your watcher provides.

eg

enum Event {
    Line(String),
    LogRotation,
}

lthiery avatar Jan 18 '22 18:01 lthiery