aboutsummaryrefslogtreecommitdiffstats
path: root/python/gevent/_ffi/__init__.py
blob: 56f1e9656e401f49a5cf5953a0976c470e9de957 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""
Internal helpers for FFI implementations.
"""
from __future__ import print_function, absolute_import

import os
import sys

def _dbg(*args, **kwargs):
    # pylint:disable=unused-argument
    pass

#_dbg = print

def _pid_dbg(*args, **kwargs):
    kwargs['file'] = sys.stderr
    print(os.getpid(), *args, **kwargs)

CRITICAL = 1
ERROR = 3
DEBUG = 5
TRACE = 9

GEVENT_DEBUG_LEVEL = vars()[os.getenv("GEVENT_DEBUG", 'CRITICAL').upper()]

if GEVENT_DEBUG_LEVEL >= TRACE:
    _dbg = _pid_dbg