|
25 | 25 | print('error: emscripten requires python 3.6 or above', file=sys.stderr) |
26 | 26 | sys.exit(1) |
27 | 27 |
|
| 28 | +from . import colored_logger |
| 29 | + |
| 30 | +# Configure logging before importing any other local modules so even |
| 31 | +# log message during import are shown as expected. |
| 32 | +DEBUG = int(os.environ.get('EMCC_DEBUG', '0')) |
| 33 | +# can add %(asctime)s to see timestamps |
| 34 | +logging.basicConfig(format='%(name)s:%(levelname)s: %(message)s', |
| 35 | + level=logging.DEBUG if DEBUG else logging.INFO) |
| 36 | +colored_logger.enable() |
| 37 | + |
28 | 38 | from .tempfiles import try_delete |
29 | 39 | from .utils import path_from_root, exit_with_error, safe_ensure_dirs, WINDOWS |
30 | | -from . import cache, tempfiles, colored_logger |
| 40 | +from . import cache, tempfiles |
31 | 41 | from . import diagnostics |
32 | 42 | from . import config |
33 | 43 | from . import filelock |
34 | 44 | from . import utils |
35 | 45 | from .settings import settings |
36 | 46 |
|
37 | 47 |
|
38 | | -DEBUG = int(os.environ.get('EMCC_DEBUG', '0')) |
39 | 48 | DEBUG_SAVE = DEBUG or int(os.environ.get('EMCC_DEBUG_SAVE', '0')) |
40 | 49 | EXPECTED_NODE_VERSION = (4, 1, 1) |
41 | 50 | EXPECTED_LLVM_VERSION = "14.0" |
42 | 51 | PYTHON = sys.executable |
43 | 52 |
|
44 | 53 | # Used only when EM_PYTHON_MULTIPROCESSING=1 env. var is set. |
45 | 54 | multiprocessing_pool = None |
46 | | - |
47 | | -# can add %(asctime)s to see timestamps |
48 | | -logging.basicConfig(format='%(name)s:%(levelname)s: %(message)s', |
49 | | - level=logging.DEBUG if DEBUG else logging.INFO) |
50 | | -colored_logger.enable() |
51 | 55 | logger = logging.getLogger('shared') |
52 | 56 |
|
53 | 57 | # warning about absolute-paths is disabled by default, and not enabled by -Wall |
|
0 commit comments