diff --git a/doc/index.html b/doc/index.html index 52f7b1e..d0ac66f 100644 --- a/doc/index.html +++ b/doc/index.html @@ -4,7 +4,7 @@
web-midi-player
#stop
+
+ #setLogger
+
+
#emitEvent
@@ -247,6 +251,10 @@ #emitEvent
+
+
+ #setLogger
+
@@ -382,7 +390,7 @@ import MidiPlayer from 'web-midi-player';
const eventLogger = (payload) => {
- console.log('Received event:', payload.event)
+ console.log('Received event:', payload.event);
}
-const midiPlayer = new MidiPlayer({ eventLogger, logging: true });
+const midiPlayer = new MidiPlayer({ eventLogger });
@@ -944,6 +952,109 @@
+ setLogger(configuration?)
+
+
+ Updates the configuration of the logger.
+ + + + + + + + + + + +parameter | +type | +description | + + +
---|---|---|
configuration |
+ + object? + + | ++ |
configuration.eventLogger | +
+ function
+
+ (default undefined )
+
+ |
+ The function that receives event payloads. + | +
configuration.logging | +
+ boolean
+
+ (default false )
+
+ |
+ Turns ON or OFF logging to the console. + | +
const eventLogger = (payload) => {
+ console.log('Received event:', payload.event);
+}
+midiPlayer.setLogger({ eventLogger });
+
+
+
+
+
+
+
+
+
+
+ setLogger(configuration?)
+
+
+ Updates the configuration of the logger.
+ + + + + + + + + + + +parameter | +type | +description | + + +
---|---|---|
configuration |
+ + object? + + | ++ |
configuration.eventLogger | +
+ function
+
+ (default undefined )
+
+ |
+ The function that receives event payloads. + | +
configuration.logging | +
+ boolean
+
+ (default false )
+
+ |
+ Turns ON or OFF logging to the console. + | +