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

Print messages directly, no logger #244

Open
matt-chan opened this issue Jun 26, 2017 · 2 comments
Open

Print messages directly, no logger #244

matt-chan opened this issue Jun 26, 2017 · 2 comments
Labels
Milestone

Comments

@matt-chan
Copy link
Member

In order to remove the Log object, we need to print messages directly to stdout.

This is straightforward except that we will then need to have a way of sorting messages by verbosity. The approach we are taking is to prepend messages with a known string (ie 5:) that contains information about verbosity. Higher numbers mean more verbose messages. Users could then grep messages directly (ie. "I want all messages with prefixes less than 5). Or we could later redirect stdout to a streamIO and parse the numbers ourselves. In either case, this would take place at the level of glue-code or higher.

@matt-chan matt-chan added this to the 3.0.0 milestone Jun 26, 2017
@matt-chan
Copy link
Member Author

One challenge with this approach is when printing things like Numpy arrays, or other multi-line objects from non-HORTON code.

There are two solutions I can think of: One is to modify the grep so that un-prefixed output retains the same level as the last prefix. Another solution is to print to a streamIO, modify the output with the correct prefixes, and then pass it to stdout. In either case, it's a small change which can be deferred for later.

@PaulWAyers
Copy link
Member

I like getting rid of the logger; I think this is more-or-less what Toon had recommended earlier. He had talked about passing a log object as an argument also, but I guess this may be preferable; it is more straightforward I think.

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

No branches or pull requests

2 participants