瀏覽代碼

Migration to loglevel for all logging statements (#265)

* refactor(logging): Migration to loglevel for all logging statements
Sebastian Haas 7 年之前
父節點
當前提交
0bb0b5e613

+ 2 - 1
src/MusicalScore/Graphical/BoundingBox.ts

@@ -1,3 +1,4 @@
+import * as log from "loglevel";
 import {ArgumentOutOfRangeException} from "../Exceptions";
 import {PointF2D} from "../../Common/DataObjects/PointF2D";
 import {SizeF2D} from "../../Common/DataObjects/SizeF2D";
@@ -201,7 +202,7 @@ export class BoundingBox {
     public set Parent(value: BoundingBox) {
         this.parent = value;
         if (this.parent.ChildElements.indexOf(this) > -1) {
-            console.error("BoundingBox of " + (this.dataObject.constructor as any).name +
+            log.error("BoundingBox of " + (this.dataObject.constructor as any).name +
             " already in children list of " + (this.parent.dataObject.constructor as any).name + "'s BoundingBox");
         } else {
             this.parent.ChildElements.push(this);

+ 0 - 1
src/MusicalScore/Graphical/VexFlow/VexFlowStaffEntry.ts

@@ -28,7 +28,6 @@ export class VexFlowStaffEntry extends GraphicalStaffEntry {
                 const staveNote: Vex.Flow.StaveNote = tickable as Vex.Flow.StaveNote;
                 tickablePosition += staveNote.getNoteHeadEndX() - staveNote.getGlyphWidth() / 2;
             } else {
-                console.log(tickable);
                 const ghostNote: Vex.Flow.GhostNote = tickable;
                 // That's basically the same as the StaveNote does.
                 tickablePosition = ghostNote.getAbsoluteX() + ghostNote.x_shift;

+ 0 - 1
src/MusicalScore/VoiceData/SourceMeasure.ts

@@ -214,7 +214,6 @@ export class SourceMeasure extends BaseIdClass {
                 }
             }
         }
-        //log.debug("created new container: ", staffEntry, this.verticalSourceStaffEntryContainers);
         return {createdNewContainer: true, staffEntry: staffEntry};
     }
 

+ 1 - 1
src/OpenSheetMusicDisplay/OpenSheetMusicDisplay.ts

@@ -175,7 +175,7 @@ export class OpenSheetMusicDisplay {
     public setLogLevel(level: string): void {
         switch (level) {
             case "trace":
-                log.setLevel(log.levels.WARN);
+                log.setLevel(log.levels.TRACE);
                 break;
             case "debug":
                 log.setLevel(log.levels.DEBUG);