# Path: python/gup/var.py
# IS_WINDOWS = sys.platform.startswith('win')


import os, sys
import logging
from .var import IS_WINDOWS
	YELLOW = "\x1b[33m"
	BOLD   = "\x1b[1m"
	PLAIN  = "\x1b[m"

_colors = {
	logging.INFO: GREEN,
	logging.WARN: YELLOW,
	logging.ERROR: RED,
	logging.CRITICAL: RED,
}

class _ColorFilter(logging.Filter):
	def filter(self, record):
		record.color = _colors.get(record.levelno, '')
		if record.levelno > logging.DEBUG:
			record.bold = BOLD
		else:
			record.bold = ''
		return True

_color_filter = _ColorFilter()

# add a trace level
TRACE_LVL = 5
def _trace(_self, message, *args, **kws):
	_self.log(TRACE_LVL, message, *args, **kws)
logging.addLevelName(TRACE_LVL, "TRACE")
logging.Logger.trace = _trace

def getLogger(*a):

# Path: python/gup/var.py
# IS_WINDOWS = sys.platform.startswith('win')


# Path: python/gup/log.py
import os, sys
import logging
from .var import IS_WINDOWS

	YELLOW = "\x1b[33m"
	BOLD   = "\x1b[1m"
	PLAIN  = "\x1b[m"

_colors = {
	logging.INFO: GREEN,
	logging.WARN: YELLOW,
	logging.ERROR: RED,
	logging.CRITICAL: RED,
}

class _ColorFilter(logging.Filter):
	def filter(self, record):
		record.color = _colors.get(record.levelno, '')
		if record.levelno > logging.DEBUG:
			record.bold = BOLD
		else:
			record.bold = ''
		return True

_color_filter = _ColorFilter()

# add a trace level
TRACE_LVL = 5
def _trace(_self, message, *args, **kws):
	_self.log(TRACE_LVL, message, *args, **kws)
logging.addLevelName(TRACE_LVL, "TRACE")
logging.Logger.trace = _trace

def getLogger(*a):

	logger = logging.getLogger(*a)