From 243fb654f6887890875f2ef4f73b5aec3c1a5d3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Magimel?= Date: Thu, 23 Nov 2017 19:30:02 +0100 Subject: [PATCH] Log: use the INFO level instead of the NOTICE one --- FoFiX.py | 4 ++-- fofix/core/Data.py | 6 +++--- fofix/core/GameEngine.py | 10 +++++----- fofix/core/Input.py | 2 +- fofix/core/Microphone.py | 2 +- fofix/core/Player.py | 2 +- fofix/core/Resource.py | 8 ++++---- fofix/core/Theme.py | 4 ++-- fofix/game/Dialogs.py | 6 +++--- fofix/game/guitarscene/Rockmeter.py | 2 +- fofix/game/guitarscene/Stage.py | 2 +- fofix/game/song/song.py | 2 +- 12 files changed, 25 insertions(+), 25 deletions(-) diff --git a/FoFiX.py b/FoFiX.py index 8e7d9a77d..c18543c74 100644 --- a/FoFiX.py +++ b/FoFiX.py @@ -220,7 +220,7 @@ def load_config(configPath): return config def restart(self): - log.notice("Restarting.") + log.info("Restarting.") self.engine.audio.close() self.restartRequested = True @@ -253,7 +253,7 @@ def run(self): while self.engine.run(): pass except KeyboardInterrupt: - log.notice("Left mainloop due to KeyboardInterrupt.") + log.info("Left mainloop due to KeyboardInterrupt.") # don't reraise # Restart the program if the engine is asking that we do so. diff --git a/fofix/core/Data.py b/fofix/core/Data.py index 693e7d988..ee0e8d20f 100644 --- a/fofix/core/Data.py +++ b/fofix/core/Data.py @@ -440,9 +440,9 @@ def getImgDrawing(self, fileName, openImage=True): fileName1 = os.path.join(dataPath, fileName) if self.logLoadings == 1: if openImage: - log.notice("Trying to load image: %s" % fileName1) + log.info("Trying to load image: %s" % fileName1) else: - log.notice("Checking image: %s" % fileName1) + log.info("Checking image: %s" % fileName1) # check if fileName1 exists (has extension) if os.path.exists(fileName1): if openImage: @@ -458,7 +458,7 @@ def getImgDrawing(self, fileName, openImage=True): else: # find extension fileName1 = os.path.splitext(fileName1)[0] - + # glob parses [] but those are legal chars on Windows, so we must escape them. # it must be done like this so replacements are not mangled # by other replacements. diff --git a/fofix/core/GameEngine.py b/fofix/core/GameEngine.py index be7c180ac..543c3bed8 100644 --- a/fofix/core/GameEngine.py +++ b/fofix/core/GameEngine.py @@ -329,7 +329,7 @@ def _initTheme(self, themename, themepath): :type themepath: str """ - log.notice( 'Setting theme %s from "%s"' % (themename,themepath) ) + log.info('Setting theme %s from "%s"' % (themename,themepath)) self.theme = None try: @@ -339,7 +339,7 @@ def _initTheme(self, themename, themepath): # Found it! Load it. theme = imp.load_module("CustomTheme", fp, pathname, description) self.theme = theme.CustomTheme(themepath, themename) - log.notice('Theme activated using custom class "%s"' % pathname) + log.info('Theme activated using custom class "%s"' % pathname) except ImportError as e: # Unable to load module; log it, but continue with default Theme. log.error('Failed to load CustomTheme.py from "%s"' % pathname) @@ -347,12 +347,12 @@ def _initTheme(self, themename, themepath): fp.close() except ImportError: # CustomTheme.py file is optional, but notify developer anyway. - log.notice("No CustomTheme.py found in theme") + log.info("No CustomTheme.py found in theme") pass if self.theme is None: self.theme = Theme(themepath, themename) - log.notice("Theme activated using built-in Theme class") + log.info("Theme activated using built-in Theme class") self.task.addTask(self.theme) def _initStages(self): @@ -481,7 +481,7 @@ def startWorld(self, players, maxplayers = None, gameMode = 0, multiMode = 0, al def finishGame(self): if not self.world: - log.notice("GameEngine.finishGame called before World created.") + log.info("GameEngine.finishGame called before World created.") return self.world.finishGame() self.world = None diff --git a/fofix/core/Input.py b/fofix/core/Input.py index d7a1e2065..a8f089a80 100644 --- a/fofix/core/Input.py +++ b/fofix/core/Input.py @@ -142,7 +142,7 @@ def __init__(self): if len(self.midi) == 0: log.debug("No MIDI input ports found.") else: - log.notice("MIDI input support is not available; install at least pygame 1.9 to get it.") + log.info("MIDI input support is not available; install at least pygame 1.9 to get it.") def showMouse(self): pygame.mouse.set_visible(True) diff --git a/fofix/core/Microphone.py b/fofix/core/Microphone.py index 3363b6b3a..195979469 100644 --- a/fofix/core/Microphone.py +++ b/fofix/core/Microphone.py @@ -114,7 +114,7 @@ def run(self, ticks): chunk = self.mic.read(1024) except IOError as e: if e.args[1] == pyaudio.paInputOverflowed: - log.notice('Microphone: ignoring input buffer overflow') + log.info('Microphone: ignoring input buffer overflow') chunk = '\x00' * 4096 else: raise diff --git a/fofix/core/Player.py b/fofix/core/Player.py index 37a47f4fb..6a926fcf5 100644 --- a/fofix/core/Player.py +++ b/fofix/core/Player.py @@ -738,7 +738,7 @@ def keyName(value): else: return name + " " + guitarkeynames[j] else: - log.notice("Key value not found.") + log.info("Key value not found.") return "Error" if self.keyCheckerMode == 0: diff --git a/fofix/core/Resource.py b/fofix/core/Resource.py index 81bab8e4f..89c4d3c62 100644 --- a/fofix/core/Resource.py +++ b/fofix/core/Resource.py @@ -123,7 +123,7 @@ def finish(self): return if self.logLoadings == 1: - log.notice("Loaded %s.%s in %.3f seconds" % (self.target.__class__.__name__, self.name, self.time)) + log.info("Loaded %s.%s in %.3f seconds" % (self.target.__class__.__name__, self.name, self.time)) if self.exception: raise self.exception[0], self.exception[1], self.exception[2] @@ -210,7 +210,7 @@ def fileName(self, *name, **args): # read-write path. readWritePath = os.path.join(getWritableResourcePath(), *name) if not os.path.isfile(readWritePath) and os.path.isfile(readOnlyPath): - log.notice("Copying '%s' to writable data directory." % "/".join(name)) + log.info("Copying '%s' to writable data directory." % "/".join(name)) try: os.makedirs(os.path.dirname(readWritePath)) except: @@ -219,7 +219,7 @@ def fileName(self, *name, **args): self.makeWritable(readWritePath) # Create directories if needed if not os.path.isdir(readWritePath) and os.path.isdir(readOnlyPath): - log.notice("Creating writable directory '%s'." % "/".join(name)) + log.info("Creating writable directory '%s'." % "/".join(name)) os.makedirs(readWritePath) self.makeWritable(readWritePath) return readWritePath @@ -252,7 +252,7 @@ def load(self, target = None, name = None, function = lambda: None, synch = Fals """ if self.logLoadings == 1: - log.notice("Loading %s.%s %s" % (target.__class__.__name__, name, synch and "synchronously" or "asynchronously")) + log.info("Loading %s.%s %s" % (target.__class__.__name__, name, synch and "synchronously" or "asynchronously")) l = Loader(target, name, function, self.resultQueue, self.loaderSemaphore, onLoad = onLoad, onCancel = onCancel) if synch: diff --git a/fofix/core/Theme.py b/fofix/core/Theme.py index cd23435ee..e97cbcec4 100644 --- a/fofix/core/Theme.py +++ b/fofix/core/Theme.py @@ -62,7 +62,7 @@ def halign(value, default='center'): def valign(value, default='middle'): try: if value.lower() == 'center': - log.notice('Use of "center" for vertical alignment is deprecated. Use "middle" instead.') + log.info('Use of "center" for vertical alignment is deprecated. Use "middle" instead.') return {'top': TOP, 'middle': MIDDLE, # for consistency with HTML/CSS terminology 'center': MIDDLE, # for temporary backward compatibility @@ -124,7 +124,7 @@ def __init__(self, path, name): if not os.path.exists(self.themePath): log.warn("Theme: %s does not exist!\n" % self.themePath) name = Config.get("coffee", "themename") - log.notice("Theme: Attempting fallback to default theme \"%s\"." % name) + log.info("Theme: Attempting fallback to default theme \"%s\"." % name) self.themePath = os.path.join(Version.dataPath(),"themes", name) if not os.path.exists(self.themePath): log.error("Theme: %s does not exist!\nExiting.\n" % self.themePath) diff --git a/fofix/game/Dialogs.py b/fofix/game/Dialogs.py index aab0d4aa7..0398ad09a 100644 --- a/fofix/game/Dialogs.py +++ b/fofix/game/Dialogs.py @@ -1990,10 +1990,10 @@ def showMessage(engine, text): """ Show a message to the user. - @param engine: Game engine - @param text: Message text + :param engine: Game engine + :param text: Message text """ - log.notice("%s" % text) + log.info(text) d = MessageScreen(engine, text) _runDialog(engine, d) diff --git a/fofix/game/guitarscene/Rockmeter.py b/fofix/game/guitarscene/Rockmeter.py index 7328377c0..2d0005073 100644 --- a/fofix/game/guitarscene/Rockmeter.py +++ b/fofix/game/guitarscene/Rockmeter.py @@ -908,7 +908,7 @@ def __init__(self, guitarScene, configFileName, coOp = False): self.customRMLayers = imp.load_module("CustomRMLayers", fp, pathname, description) except ImportError: self.customRMLayers = None - log.notice("Custom Rockmeter layers are not available") + log.info("Custom Rockmeter layers are not available") # Build the layers for i in range(Rockmeter._layerLimit): diff --git a/fofix/game/guitarscene/Stage.py b/fofix/game/guitarscene/Stage.py index 8c9e5d6ce..1c1ec7f23 100644 --- a/fofix/game/guitarscene/Stage.py +++ b/fofix/game/guitarscene/Stage.py @@ -430,7 +430,7 @@ def load(self, libraryName, songName, practiceMode = False): elif self.songStage == 1: #check for song-specific background test = True if not self.engine.loadImgDrawing(self, "background", os.path.join(libraryName, songName, "background")): - log.notice("No song-specific stage found") # evilynux + log.info("No song-specific stage found") test = False if test: #does a song-specific background exist? self.rotationMode = 0 diff --git a/fofix/game/song/song.py b/fofix/game/song/song.py index 689357f0d..c0119be66 100644 --- a/fofix/game/song/song.py +++ b/fofix/game/song/song.py @@ -2850,7 +2850,7 @@ def start_of_track(self, n_track=0): log.debug(tempText + tempText2) self.firstTrack = True else: - log.notice("This song has multiple tracks, none properly named. Behavior may be erratic.") + log.info("This song has multiple tracks, none properly named. Behavior may be erratic.") def sequence_name(self, text): """ Track name encountered in file, see if we can match it to an instrument part. """