You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm planning to add a feature to 'unsplit' that allows me to plug in a logging function other than io:fwrite (e.g., lager or something custom), with the plugged-in function used throughout all unsplit modules.
The basic plan is to store a setting in the application's env identifying the logging function (a {Module, FunctionName} tuple). A table-specific setting specified in the {user_properties, ...} of a Mnesia table could be used additionally, but that's not something I would find useful for my purposes; if you or the user community thinks that has use, it's something I can tackle.
Calls to io:fwrite and error_logger:format would be replaced with calls to io_lib:format, along with passing the resulting string to whatever log function has been configured (with the default being io:fwrite). Log functions would be expected to have this type specification:
Hello,
I'm planning to add a feature to 'unsplit' that allows me to plug in a logging function other than io:fwrite (e.g., lager or something custom), with the plugged-in function used throughout all unsplit modules.
The basic plan is to store a setting in the application's env identifying the logging function (a {Module, FunctionName} tuple). A table-specific setting specified in the {user_properties, ...} of a Mnesia table could be used additionally, but that's not something I would find useful for my purposes; if you or the user community thinks that has use, it's something I can tackle.
Calls to io:fwrite and error_logger:format would be replaced with calls to io_lib:format, along with passing the resulting string to whatever log function has been configured (with the default being io:fwrite). Log functions would be expected to have this type specification:
-type unsplit_log_fun() :: fun((string()) -> 'ok').
Pull request forthcoming, but wanted to begin with a heads up, along with my thanks for a very useful project!
The text was updated successfully, but these errors were encountered: