Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
pmd333
Level 7

Brightscript logging and error handling

hi,

I am new to channel development and would like to make a simple arithmetic app. I would like to put in logging and error handling into my bs in the beginning, but I'm not experienced in doing that because I have usually relied on a debugger for that instead. It would be nice to also eventually turn the logging into something that could be used for tracing user problems and logging some statistics on user behavior to a server. So I'm tempted to do something strange like rely on the eval/run commands, but I'm trying to resist. I'm hoping someone more experienced can provide some tips.

Thank you,
pmd
0 Kudos
8 Replies
dev42
Level 7

Re: Brightscript logging and error handling

"pmd333" wrote:
So I'm tempted to do something strange like rely on the eval/run commands

I'll parrot what the guru's around these parts have said, "don't use eval/run". That said, if you're looking to make a data driven app that pulls "lessons" / "levels" from the 'net, I'm sure it can be done!

I'm also sure you can do logging and save it to the 'net.... but unfortunately, I don't know how ( yet ) and I'm not well versed in the privacy concerns. You can fetch an ID/model # from the unit, but what if your demographic included families with more than one student? or twins?!
0 Kudos
pmd333
Level 7

Re: Brightscript logging and error handling

It looks like someone posted a library to help get started called librokudev on github. I will start there.
0 Kudos
pmd333
Level 7

Re: Brightscript logging and error handling

Also someone posted brstest on github. Maybe I can use that to help with testing and cut down on the need for logging and error handling.
0 Kudos
sna
Level 7

Re: Brightscript logging and error handling

Hi,

I'm new to ROKU, I'm just exploring how to use brstest. If anybody can let me know how can I use brstest with example programs will be very helpful and appreciated.
0 Kudos
sjb64
Level 7

Re: Brightscript logging and error handling

Might be a dumb question but...

If you wrote an app that downloaded an external file to a string or tmp:/ (containing code) that was then processed using Eval/Run, could that app even pass QA for a public channel? There would be no way to test the future downloaded code to ensure it met standards and rules (not a menu system, etc.), as the code could be changed at will after publication.
FlixRaider channel
0 Kudos
renojim
Level 8

Re: Brightscript logging and error handling

Part of the Developer Agreement states: "The Channel Applications will not download or install executable code." Seems to me that downloading BRS and executing it with Run/Eval would violate this. I'm not sure how long that clause has been around since I know of at least one very old public channel that did just that.

-JT
0 Kudos
Komag
Level 9

Re: Brightscript logging and error handling

I don't think that counts, you would be downloading brightscript code, which I would interpret is just passive code, not downloading and running some sort of exe file, which I think that rule specifically is talking about. But of course I may be wrong.
0 Kudos
sjb64
Level 7

Re: Brightscript logging and error handling

On a Roku with the eval/run ability, Brightscript is executable code, so I think it would definitely be the target of that clause. I don't know if anyone at Roku actually unzips the package and looks at source code, either manually or by an automated system looking for triggers so see if clauses like there are violated. But regardless, my concern, which it turns out TheEndless has addressed previously in the forums, is addressed.

On a side note, I didn't mean to hijack pmd333's thread, if anyone wants to continue this discussion let's start a new thread.
FlixRaider channel
0 Kudos