chemist-preprocessor-0.1.0.0: Chemist Raw Data Preprocessor
Safe HaskellSafe-Inferred
LanguageHaskell2010

API.Logger

Description

This module provides a simple logging functionality for recording messages with different log levels (Error and Info). It uses the FastLogger library to log messages with timestamps to the standard output. The logging system captures UTCTime to ensure accurate time-stamped logs. The log function can handle both Left and Right values, logging them accordingly based on their presence in the context of errors or informational messages.

Synopsis

Documentation

log :: (Show a, Show b) => Either a b -> IO () #

Logs a message based on the value of an Either type.

The log function accepts an 'Either a b' value where:

  • If it is Left, it logs an error message with the Error log level.
  • If it is Right, it logs an informational message with the Info log level.

Each log entry is timestamped using the current UTC time, and messages are printed to standard output. The logger is flushed after logging to ensure all messages are displayed promptly.