commercialhaskell / rio

A standard library for Haskell
Other
835 stars 54 forks source link

Silent LogLevel #184

Closed karamellpelle closed 5 years ago

karamellpelle commented 5 years ago

Shouldn't there be a functionsetLogSilent :: LogOptions -> LogOptions to use on the LogOptions data? Because sometimes a (command line) program shouldn't produce output when run through a bash script, for example.

snoyberg commented 5 years ago

In such a case, you can use mempty as the LogFunc.

karamellpelle commented 5 years ago

Yes, but I thought setLogSilent :: LogOptions -> LogOptions could be more consistent with the existing functions setLogMinLevel and logSetVerboseFormat. rio already exposes a noLogging :: (HasLogFunc env, MonadReader env m) => m a -> m a function.

This is just a suggestion. I do not have a strong opinion about this.