-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Akka.NET F# API has two sets of logging functions:
- logDebug, logError etc.
- logDebugf, logErrorf etc.
The second set calls kprintf internall so it's possible to use syntax like this:
logDebugf mmailbox "This is an integer %d, and this is a string %s" 123 "abc"
None of the above will work with semantic logging. So in order to use semanting logging a method on ILogginAdapter must be called:
logger.Debug("This is an integer {IntValue}, and this is a string {StringValue}", 123, "abc")
Would it be suitable to extend F# API with idiomatic calls by adding a set of functions logDebugs, logErrors etc., so the following syntax could be used:
`logDebugs "This is an integer {IntValue}, and this is a string {StringValue}" [ 123; "abc" ]
The methods for semantic logging need to be defined like this:
let logDebugs (mailbox: Actor) (msg: string) (args: obj seq) =
let logger = mailbox.Log.Force()
logger.Log(LogLevel.DebugLevel, msg, Seq.toArray args)
What do you think? I am maintaining an alternative F# API (Akkling) and would like to extend it similarly.