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

Ability to log errors to a file object #12

Open
martinohanlon opened this issue Jun 4, 2018 · 4 comments
Open

Ability to log errors to a file object #12

martinohanlon opened this issue Jun 4, 2018 · 4 comments

Comments

@martinohanlon
Copy link
Owner

Rather than raised errors, the option should exist to log errors to an open file object, including stderr.

Based on requests in #7 from @kiwi0fruit

@martinohanlon
Copy link
Owner Author

If ShortCutter is not in silent mode #11 errors will be raised.

ShortCutter should accept an error_file IO object on the constructor (defaulted to None) which when set causes errors to also be written to the error_file and not raised as exceptions.

@kiwi0fruit
Copy link

kiwi0fruit commented Jun 4, 2018

I suggest explicit skip_errors=True/False and error_log=None/sys.stderr/io.StringIO() where None means silent mode. This way skipping errors cannot be activated in two different ways (as you suggest).

@martinohanlon
Copy link
Owner Author

How do you see skip_error being different to silent'? silent seems more prescriptive than skip_errors - the error cant be skipped, they are simply not reported.

if error_log=None means silent, how would a user get python exceptions raised?

@kiwi0fruit
Copy link

kiwi0fruit commented Jun 4, 2018

if error_log=None means silent, how would a user get python exceptions raised?

skip_errors=False raises exceptions. I want to say that an explicit switch for raising/not raising mode is better. How to call it? raise_errors=True/False?

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

2 participants