How to use the bigflow.util.log.logger.warn function in bigflow

To help you get started, we’ve selected a few bigflow examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github baidu / bigflow / bigflow_python / python / bigflow / pipeline / pipeline_base.py View on Github external
import sys
        if will_pass_encoding is None:
            """
            By default,
            if user has reloaded module "sys", we should pass defaultencoding to the remote side.
            Because "reload(sys)" and "sys.setdefaultencoding(encoding)" are most probably related.

            TODO(zhangyuncong):
                We should have a further discussion about
                whether we should pass the encoding by default or not.
            """
            will_pass_encoding = hasattr(sys, 'setdefaultencoding')

        if will_pass_encoding:
            default_encoding = sys.getdefaultencoding()
            logger.warn("pass defaultencoding %s to the remote side" % default_encoding)
            def set_default_encoding():
                import sys
                reload(sys)
                sys.setdefaultencoding(default_encoding)

            # \0 makes sure this hook will run before user's
            self.set_init_hook('\0set_sys_defaultencoding', set_default_encoding)