Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pluggable logging, instead of io:fwrite calls #6

Open
alexthornton1 opened this issue Jan 3, 2013 · 1 comment
Open

Pluggable logging, instead of io:fwrite calls #6

alexthornton1 opened this issue Jan 3, 2013 · 1 comment

Comments

@alexthornton1
Copy link

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!

  • Alex
@alexthornton1
Copy link
Author

Pull request is here. Many thanks!

  • Alex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant