fbt fixes for mfbt pt2 (#1951)
* fbt: split sdk management code * scripts: fixed import handling * fbt: sdk: reformatted paths * scrips: dist: bundling libs as a build artifact * fbt: sdk: better path management * typo fix * fbt: sdk: minor path handling fixes * toolchain: fixed windows toolchain download * fbt: minor refactorin * fbt: moved sdk management code to extapps.scons * fbt: fixed sdk symbols header path; disabled -fstack-usage * fbt: changed pathing for .py scripts * fbt: changed SDK_HEADERS pathing; added libusb to SDK; added icon_i.h to SDK; added hw target to SDK meta * fbt: added libusb headers to SDK * picopass: include cleanup; api: added subghz/registry.h; api: added mbedtls to exported headers * picopass: fixed formatting * fbt: fixed COPRO_ASSETS_SCRIPT * sdk: added basic infrared apis * toolchain: added ufbt to list of legal fbtenv callers; updated error messages * fbt: changed manifest collection & icon processing code * fbt: simpler srcdir lookup * toolchain: path management fixes; fbt: fixes for fap private libs paths * scripts: toolchain: reworked download on Windows * toolchain: v17 * scripts: added colorlog for logging * Github: fix unit tests Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import logging
|
||||
import argparse
|
||||
import sys
|
||||
import colorlog
|
||||
|
||||
|
||||
class App:
|
||||
@@ -10,7 +11,7 @@ class App:
|
||||
self.parser = argparse.ArgumentParser()
|
||||
self.parser.add_argument("-d", "--debug", action="store_true", help="Debug")
|
||||
# Logging
|
||||
self.logger = logging.getLogger()
|
||||
self.logger = colorlog.getLogger()
|
||||
# Application specific initialization
|
||||
self.init()
|
||||
|
||||
@@ -21,10 +22,17 @@ class App:
|
||||
self.log_level = logging.DEBUG if self.args.debug else logging.INFO
|
||||
self.logger.setLevel(self.log_level)
|
||||
if not self.logger.hasHandlers():
|
||||
self.handler = logging.StreamHandler(sys.stdout)
|
||||
self.handler = colorlog.StreamHandler(sys.stdout)
|
||||
self.handler.setLevel(self.log_level)
|
||||
self.formatter = logging.Formatter(
|
||||
"%(asctime)s [%(levelname)s] %(message)s"
|
||||
self.formatter = colorlog.ColoredFormatter(
|
||||
"%(log_color)s%(asctime)s [%(levelname)s] %(message)s",
|
||||
log_colors={
|
||||
"DEBUG": "cyan",
|
||||
# "INFO": "white",
|
||||
"WARNING": "yellow",
|
||||
"ERROR": "red",
|
||||
"CRITICAL": "red,bg_white",
|
||||
},
|
||||
)
|
||||
self.handler.setFormatter(self.formatter)
|
||||
self.logger.addHandler(self.handler)
|
||||
|
Reference in New Issue
Block a user