Преглед изворни кода

Fixed mixup with logging frameworks.

Matthias Uiberacker пре 7 година
родитељ
комит
e02661b4fd
2 измењених фајлова са 10 додато и 10 уклоњено
  1. 3 3
      src/MusicalScore/ScoreIO/MusicSymbolModules/ArticulationReader.ts
  2. 7 7
      src/OSMD/OSMD.ts

+ 3 - 3
src/MusicalScore/ScoreIO/MusicSymbolModules/ArticulationReader.ts

@@ -1,6 +1,6 @@
 import {ArticulationEnum, VoiceEntry} from "../../VoiceData/VoiceEntry";
 import {IXmlAttribute, IXmlElement} from "../../../Common/FileIO/Xml";
-import {Logging} from "../../../Common/Logging";
+import * as log from "loglevel";
 import {TechnicalInstruction, TechnicalInstructionType} from "../../VoiceData/Instructions/TechnicalInstruction";
 import {OrnamentContainer, OrnamentEnum} from "../../VoiceData/OrnamentContainer";
 import {PlacementEnum} from "../../VoiceData/Expressions/AbstractExpression";
@@ -54,9 +54,9 @@ export class ArticulationReader {
               currentVoiceEntry.Articulations.push(articulationEnum);
             }
           }
-        } catch (err) {
+        } catch (ex) {
           let errorMsg: string = "Invalid note articulation.";
-          Logging.log("addArticulationExpression", errorMsg);
+          log.debug("addArticulationExpression", errorMsg, ex);
           return;
         }
       }

+ 7 - 7
src/OSMD/OSMD.ts

@@ -170,23 +170,23 @@ export class OSMD {
     public setLogLevel(level: string): void {
         switch (level) {
             case "trace":
-                log.setLevel(LogLevel.TRACE);
+                log.setLevel(log.levels.WARN);
                 break;
             case "debug":
-                log.setLevel(LogLevel.DEBUG);
+                log.setLevel(log.levels.DEBUG);
                 break;
             case "info":
-                log.setLevel(LogLevel.INFO);
+                log.setLevel(log.levels.INFO);
                 break;
             case "warn":
-                log.setLevel(LogLevel.WARN);
+                log.setLevel(log.levels.WARN);
                 break;
             case "error":
-                log.setLevel(LogLevel.ERROR);
+                log.setLevel(log.levels.ERROR);
                 break;
             default:
                 log.warn(`Could not set log level to ${level}. Using warn instead.`);
-                log.setLevel(LogLevel.WARN);
+                log.setLevel(log.levels.WARN);
                 break;
         }
     }
@@ -243,7 +243,7 @@ export class OSMD {
             timeout = undefined;
             window.clearTimeout(timeout);
             if ((new Date()).getTime() - rtime < delta) {
-                timeout = window.setTimeout(this.resizeEnd, delta);
+                timeout = window.setTimeout(resizeEnd, delta);
             } else {
                 endCallback();
             }