Author: ayoung
Date: Wed Oct 6 01:55:16 2010
New Revision: 9151
URL: http://svn.slimdevices.com/jive?rev=9151&view=rev
Log:
task : SN test harness
Include MAC address in log messages
Modified:
7.6/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/ScriptPlay/ScriptPlayApplet.lua
Modified:
7.6/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/ScriptPlay/ScriptPlayApplet.lua
URL:
http://svn.slimdevices.com/jive/7.6/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/ScriptPlay/ScriptPlayApplet.lua?rev=9151&r1=9150&r2=9151&view=diff
==============================================================================
---
7.6/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/ScriptPlay/ScriptPlayApplet.lua
(original)
+++
7.6/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/ScriptPlay/ScriptPlayApplet.lua
Wed Oct 6 01:55:16 2010
@@ -9,6 +9,7 @@
local Applet = require("jive.Applet")
local Framework = require("jive.ui.Framework")
+local System = require("jive.System")
local Player = require("jive.slim.Player")
local macro = require("applets.MacroPlay.MacroPlayApplet")
@@ -53,11 +54,11 @@
local f, dirorerr = loadconfigfile(file)
if f then
self.config = f()
- log:info("Loaded config from ", dirorerr, file)
+ log:info(System:getMacAddress(), ': ',"Loaded config from ",
dirorerr, file)
elseif dirorerr then
- log:warn("Error loading config from ", file, ": ", dirorerr)
- else
- log:warn("No config file found: ", file)
+ log:warn(System:getMacAddress(), ': ',"Error loading config
from ", file, ": ", dirorerr)
+ else
+ log:warn(System:getMacAddress(), ': ',"No config file found: ",
file)
end
return f ~= nil
end
@@ -70,7 +71,7 @@
function notify_playerModeChange(self, player, mode)
if player ~= self.player then return end
- log:info('mode=', mode)
+ log:info(System:getMacAddress(), ': ','mode=', mode)
self.isPlaying = mode == 'play'
if not self.isPlaying and self.timerAction then
@@ -82,11 +83,11 @@
function notify_playerCurrent(self, player)
self.player = player
self.isPlaying = player:getPlayerMode() == 'play'
- log:info('player=', player)
+ log:info(System:getMacAddress(), ': ','player=', player)
end
function _play(self, track)
- log:info('_play: track=', track or 'undef')
+ log:info(System:getMacAddress(), ': ','_play: track=', track or 'undef')
-- go home
macro.macroHome(500, 10000) -- long delay to allow for startup
@@ -171,7 +172,7 @@
function _waitToFinish(self, endTime)
local duration = endTime - Framework:getTicks()
- log:info('_waitToFinish: duration=', duration)
+ log:info(System:getMacAddress(), ': ','_waitToFinish: duration=',
duration)
if duration > 0 then
macro.macroDelay(duration)
@@ -191,7 +192,7 @@
function _checkPlaying(self, endTime)
local duration = endTime - Framework:getTicks()
- log:info('_checkPlaying: duration=', duration)
+ log:info(System:getMacAddress(), ': ','_checkPlaying: duration=',
duration)
if duration > 60000 then
macro.macroDelay(60000)
@@ -202,7 +203,7 @@
elseif
interrupt then
self:_checkPlaying(endTime)
else
-
log:warn('Track not playing');
+
log:warn(System:getMacAddress(), ': ','Track not playing');
self.running = false
end
end
@@ -219,7 +220,7 @@
local index = math.random(#self.config.records)
self.config.record = self.config.records[index]
self.config.records = nil
- log:info('Using test record #', index, ' entries=',
#self.config.record)
+ log:info(System:getMacAddress(), ': ','Using test record #',
index, ' entries=', #self.config.record)
end
self.running = true
@@ -245,7 +246,7 @@
startIn = 10000
end
- log:info('playTrack: startIn=', startIn, ', track=', track)
+ log:info(System:getMacAddress(), ': ','playTrack: startIn=', startIn,
', track=', track)
if (startIn > 0) then
if (self.isPlaying and startIn > 5000) then
_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/jive-checkins