fp-go-logging
Installation
SKILL.md
fp-go Logging
Overview
fp-go provides logging utilities that integrate naturally with functional pipelines. Logging is always a side effect — it should not change the value being processed. The library achieves this through ChainFirst-style combinators that thread the original value through unchanged while performing the log.
Packages
| Package | Purpose |
|---|---|
github.com/IBM/fp-go/v2/logging |
Global logger, context-embedded logger, LoggingCallbacks |
github.com/IBM/fp-go/v2/io |
Logf, Logger, LogGo, Printf, PrintGo — IO-level logging helpers |
github.com/IBM/fp-go/v2/readerio |
SLog, SLogWithCallback — structured logging for ReaderIO |
github.com/IBM/fp-go/v2/context/readerio |
SLog, SLogWithCallback — structured logging for context ReaderIO |
github.com/IBM/fp-go/v2/context/readerresult |
SLog, TapSLog, SLogWithCallback — structured logging for ReaderResult |
github.com/IBM/fp-go/v2/context/readerioresult |
SLog, TapSLog, SLogWithCallback, LogEntryExit, LogEntryExitWithCallback — full suite for ReaderIOResult |
Logging Inside Pipelines
The idiomatic way to log inside a monadic pipeline is ChainFirstIOK (or ChainFirst where the monad is already IO). These combinators execute a side-effecting function and pass the original value downstream unchanged.