BUG: Logbook 0.10.0 requires explicit handler

As of logbook 0.10.0, logbook no longer installs a default handler,
which means that if the application doesn't install one, log messages
disappear into the ether.

Therefore, all of our scripts with `__main__` endpoints need to push a
`logbook.StderrHandler` if they're not already pushing some other
handler.
This commit is contained in:
Jonathan Kamens
2015-07-28 04:38:41 -04:00
parent 576e4184d7
commit dca679edcb
5 changed files with 10 additions and 0 deletions
@@ -14,6 +14,7 @@
# limitations under the License.
import datetime
import logbook
import os
import pickle
import pytz
@@ -136,6 +137,7 @@ def generate_object_state(cls, initargs):
if __name__ == "__main__":
logbook.StderrHandler().push_application()
for args in argument_list:
generate_object_state(*args)
+2
View File
@@ -14,11 +14,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import logbook
import sys
from zipline.utils import parse_args, run_pipeline
if __name__ == "__main__":
logbook.StderrHandler().push_application()
parsed = parse_args(sys.argv[1:])
run_pipeline(print_algo=True, **parsed)
sys.exit(0)