a bit more logging
This commit is contained in:
Родитель
943e788966
Коммит
180dfcb404
|
@ -44,9 +44,8 @@ namespace jacdac {
|
|||
}
|
||||
|
||||
add(priority: jacdac.LoggerPriority, message: string): void {
|
||||
if (!this.running) return; // nothing to do
|
||||
if (!message || !message.length || priority < this.minPriority
|
||||
|| !this._lastListenerTime)
|
||||
if (!this.running || !message || !message.length) return; // nothing to do
|
||||
if (priority < this.minPriority || !this._lastListenerTime)
|
||||
return;
|
||||
|
||||
// no one listening?
|
||||
|
|
2
pxt.json
2
pxt.json
|
@ -62,7 +62,7 @@
|
|||
},
|
||||
"public": true,
|
||||
"targetVersions": {
|
||||
"target": "3.1.81",
|
||||
"target": "3.1.82",
|
||||
"targetId": "microbit"
|
||||
},
|
||||
"supportedTargets": [
|
||||
|
|
|
@ -912,14 +912,17 @@ namespace jacdac {
|
|||
queueAnnounce()
|
||||
break
|
||||
case ControlCmd.Identify:
|
||||
this.log("identify")
|
||||
if (onIdentifyRequest)
|
||||
control.runInParallel(onIdentifyRequest)
|
||||
if (onStatusEvent) onStatusEvent(StatusEvent.Identify)
|
||||
break
|
||||
case ControlCmd.Reset:
|
||||
this.log("reset requested")
|
||||
control.reset()
|
||||
break
|
||||
case ControlCmd.FloodPing:
|
||||
this.log("flood")
|
||||
this.handleFloodPing(pkt)
|
||||
break
|
||||
}
|
||||
|
|
4
test.ts
4
test.ts
|
@ -194,7 +194,7 @@ namespace modules {
|
|||
modules.humidity.start()
|
||||
forever(() => {
|
||||
const h = modules.humidity.humidity()
|
||||
console.debug(`debug message`)
|
||||
console.log(`humidity: ${h} (this is a log message)`)
|
||||
// console.debug(`debug message`)
|
||||
// console.log(`humidity: ${h} (this is a log message)`)
|
||||
pause(1000)
|
||||
})
|
||||
|
|
Загрузка…
Ссылка в новой задаче