joetesta
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2016
12:35 PM
roSystemLog documentation incomplete
There is example code here https://sdkdocs.roku.com/display/sdkdoc/roSystemLog
which copied simply causes a crash;
Obviously the 'httpIpAddrs' object needs to be initialized, but what is the point of this object, is it explained elsewhere?
which copied simply causes a crash;
Current Function:
119: ' Handle the roSystemLogEvents:'
120: i = msg.GetInfo()
121: If i.LogType = "http.error" or i.LogType = "http.connect"
122: If i.LogType = "http.error"
123: metrics.errorCount = metrics.errorCount + 1
124: print "http error: "; i.HttpCode; "URL: ";i.Url
125: End If
126: url = i.OrigUrl
127:* If (not httpIpAddrs.DoesExist(url)) Then
128: httpIpAddrs[url] = CeateObject("roAssociativeArray")
129: End If
130: httpIpAddrs[url].AddReplace(i.TargetIp,"")
131: Else If i.LogType = "bandwidth.minute"
'Dot' Operator attempted with invalid BrightScript Component or interface reference. (runtime error &hec) in pkg:/source/Main.brs(127)
127: If (not httpIpAddrs.DoesExist(url)) Then
Backtrace:
#1 Function appeventloop(app As Dynamic) As Dynamic
file/line: pkg:/source/Main.brs(127)
#0 Function main(args As Dynamic) As Dynamic
file/line: pkg:/source/Main.brs(51)
Local Variables:
Obviously the 'httpIpAddrs' object needs to be initialized, but what is the point of this object, is it explained elsewhere?
aspiring
1 REPLY 1
belltown
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2016
01:08 PM
Re: roSystemLog documentation incomplete
It looks like they're just trying to maintain a list of ip addresses for their own logging purposes, but as you noted they have not initialized the object. You don't need that part; you can do whatever you want with the log data. Obviously, their code wasn't tested (I don't think the compiler will like CeateObject either).