Feature/logger (#147)

* todos

* New logger

* Remove roku-log
This commit is contained in:
Brahim Hadriche authored and GitHub committed 2023-09-19 17:49:48 -04:00
1 parent cf6d89f44f
commit 190dcdffe3
37 files changed
+417 -291

No files matched your search

@@ -1,5 +1,5 @@
import "pkg:/source/utils/Types.bs"
import "pkg:/source/roku_modules/log/LogMixin.brs"
import "pkg:/source/utils/Logging.bs"
import "pkg:/source/asyncTask/asyncTask.bs"
import "pkg:/components/VideoFeed/VideoRowListContentTask.bs"
import "pkg:/components/VideoFeed/VideoRowListRowContentTask.bs"
@@ -14,8 +14,6 @@ function Init()
end function
function OnNodeReady()
m.log = new log.Logger("VideoRowList")
m.top.ObserveField("itemFocused", FuncName(OnItemFocused))
m.top.ObserveField("rowItemFocused", FuncName(OnRowItemFocused))
m.top.ObserveField("rowItemSelected", FuncName(OnRowItemSelected))
@@ -70,15 +68,15 @@ function OnRowItemSelected(event as object)
if rowItem.type = "video"
videoId = rowItem.videoId
m.log.info("Play video: " + videoId)
LogInfo("Play video: " + videoId)
m.playQueue@.Play(rowItem, -1)
else if rowItem.type = "playlist"
playlistId = rowItem.playlistId
m.log.info("Open playlist: " + playlistId)
LogInfo("Open playlist: " + playlistId)
PlaylistUtils.Open(rowItem)
else if rowItem.type = "channel"
authorId = rowItem.authorId
m.log.info("Open channel: " + authorId)
LogInfo("Open channel: " + authorId)
ChannelUtils.Open(rowItem)
else if rowItem.type = "action"
if rowItem.action = "LoginDialog"
@@ -90,7 +88,7 @@ function OnRowItemSelected(event as object)
end function
function OnAuthTokenChange()
' TODO:P1: Reload only content that is authenticated
' TODO:P2: Reload only content that is authenticated
' Should not reload if the page is not visible. Instead, capture state and reload when the page becomes visible
InitContent()
end function
@@ -197,7 +195,7 @@ function OnVideoRowListRowContentTaskResult(output as object) as void
error = output.result.error
end if
error = ErrorUtils.Format(error)
m.log.error(error)
LogError(error)
m.top.onError = error
message = `Failed to load feed\n${error}`
DialogUtils.ShowDialog(message, "Feed load fail", true)