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

Arbitrary Output Objects #5

Open
acook opened this issue Mar 12, 2013 · 2 comments
Open

Arbitrary Output Objects #5

acook opened this issue Mar 12, 2013 · 2 comments
Assignees

Comments

@acook
Copy link
Owner

acook commented Mar 12, 2013

Right now Output is restricted to IO and StringIO objects, what would be more ideal is the ability to use an arbitrary Object as long as it implements a common interface.

Use Case

  • Given an application that requires logging to a database
  • Then Logsaber can write out each chunk of information to specified columns

This requires two parts:

  • A formatter that returns a list/dictionary instead of a string
  • A standard output object interface
@ghost ghost assigned acook Mar 12, 2013
@acook
Copy link
Owner Author

acook commented Sep 10, 2013

To go into more detail, Logsaber uses the standard IO interface of print/puts/write/close. This functionality should be moved to an IOAdapter object that is passed the raw information given to Logsaber by the logging method and wraps the basic functionality of outputting to IO and loading IO formatters. An ObjectAdapter type would do the same, but instead output whatever objects dictated by the Object formatters. For example a simple OStruct formatter would be useful for other parts of the system to parse and potentially auto-heal based on errors encountered in other places of the application without halting execution.

@acook
Copy link
Owner Author

acook commented Sep 10, 2013

This commit finally separates the main intelligent logging element from the text log generation: 5824f58

There's still no way to specify formatters and it will probably be ideal to pass the Entry instance into the formatter so that everything can be lazy evaled as needed.

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

No branches or pull requests

1 participant