mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-15 11:22:18 +08:00
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:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user