log

Input series must start with non-zero term.
equalTrunc 500 PSE.logExpl (PS.log (\1 -> 0) [1,1])
equalTrunc 100 (0:1:repeat 0) (PS.log (\1 -> 0) PSE.exp)
checkHoles 30 (PS.log (\1 -> 0)) 1
Basic logging function. Uses formatLogHere. Is not thread-safe.
If sucessful, parsing will stop after the first CR or LF newline marker if any, otherwise it will consume all input.
Renders a Log on its own line. Doesn't include a trailing newline character. For example:
2019-11-15T18:05:54.949470902Z NOTICE Welcome to my program!
2019-11-15T18:05:54.949623731Z /initialization NOTICE Starting web server
2019-11-15T18:05:54.949630205Z /initialization ALERT Disk is almost full!!!
2019-11-15T18:05:54.949640299Z /server port=80 INFO Listening for new clients
2019-11-15T18:05:54.949652133Z /server port=80 /handler client-address=10.0.0.8 INFO Connection established
2019-11-15T18:05:54.949664482Z /server port=80 /handler client-address=10.0.0.8 WARNING user error (Oops!)
Since the normal log throws an error on zero, we have to redefine it in order for things to work right. Arguing from limits we can see that log 0 == negativeInfinity. Newer versions of GHC have this behavior already, but older versions and Hugs do not. This function will raise an error when taking the log of negative numbers, rather than returning notANumber as the newer GHC implementation does. The reason being that typically this is a logical error, and notANumber allows the error to propagate silently. In order to improve portability, the Transfinite class is required to indicate that the Floating type does in fact have a representation for negative infinity. Both native floating types (Double and Float) are supported. If you define your own instance of Transfinite, verify the above equation holds for your 0 and negativeInfinity. If it doesn't, then you should avoid importing our log and will probably want converters to handle the discrepancy. For GHC, this version of log has rules for fusion with exp. These can give different behavior by preventing overflow to infinity and preventing errors for taking the logarithm of negative values. For Double and Float they can also give different answers due to eliminating floating point fuzz. The rules strictly improve mathematical accuracy, however they should be noted in case your code depends on the implementation details.
Log a message msg with a particular importance level. Notice that function requires a MonadIO constraint. If you want to log from other monads that don't satisfy this constraint but are somehow able to perform or build STM actions, then use log' instead.
log = log' (liftIO . atomically)
Refer to log' for more documentation.
Logs the message with given severity sev.
Log a message. If you semantic monad Sem has effect Log then you can send messages of type msg to that effect. This function can be used like this:
application :: Member (Log String) r => Sem r ()
application = do
log "Application started..."
log "Application finished..."
Produce a log message with specified log level.
Log a message with the given importance level. This function returns immediately after queing the message for logging. The actual printing of the log message will happen in a different thread, asynchronously. If you want to explicitly wait for the message to be logged, then call flush afterwards. Log messages are rendered in FIFO order, and their timestamp records the time when this log function was called, rather than the time when the log message is printed in the future. Note regarding exceptions: Any exception thrown by natSTM will be thrown here. Synchronous exceptions that happen due to failures in the actual committing of the log message, which itself is performed in a different thread, are ignored (they should be handled in the function passed to new instead). If an asynchronous exception kills the logging thread, then you will synchronously get ExceptionInLoggingWorker here, but by the time that happens, that same exception will have already already been thrown asynchronously to this same thread anyway, so unless you did something funny to recover from that exception, you will have died already.