import math
import sounddevice as sd
import logging
+Logger = logging.getLogger("kivy")
from . import sysfont
sys.argv.extend(kivy_args)
+ os.environ["KIVY_NO_CONFIG"] = 'true'
+ sys.argv.extend(["-c", "kivy:log_level:warning"])
+ sys.argv.extend(["-c", "kivy:log_dir:/tmp"])
+ sys.argv.extend(["-c", "kivy:log_name:/tmp/music_sampler_%_.txt"])
+
parser = argparse.ArgumentParser(
description="A Music Sampler application.",
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
help="Kivy arguments. All arguments after this are interpreted\
by Kivy. Pass \"-- --help\" to get Kivy's usage.")
- from kivy.logger import Logger
- Logger.setLevel(logging.WARN)
-
args = parser.parse_args(argv)
Config.yml_file = args.config
class DebugModeAction(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
- from kivy.logger import Logger
- Logger.setLevel(logging.DEBUG)
+ sys.argv.extend(["-c", "kivy:log_level:debug"])
class SelectDeviceAction(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
max(volume, 0)]
def debug_print(message, with_trace=False):
- from kivy.logger import Logger
Logger.debug('MusicSampler: ' + message, exc_info=with_trace)
def error_print(message, with_trace=False):
- from kivy.logger import Logger
Logger.error('MusicSampler: ' + message, exc_info=with_trace)
def warn_print(message, with_trace=False):
- from kivy.logger import Logger
Logger.warn('MusicSampler: ' + message, exc_info=with_trace)