Announcement

Collapse
No announcement yet.

HS2 Web Page Builder - incorporating a mini log view section

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    HS2 Web Page Builder - incorporating a mini log view section

    Hello,

    Has anyone developed a way to show the last 10 or 15 HS log entries into their web page?

    Thanks,

    Todd
    -Todd

    ____________________________________________________________ ________________
    HS2Pro: 2.5.0.81 :: HS3Pro (beta) || Plugins:| SmartHome PowerLinc USB, Global Cache, BLBackup, DooCPU Monitor, DooMotion, BLOutlook, BLIcon, BLOutgoingCalls, OutgoingCalls, ROC-Rnd, HSTouch iPhone, UPS Monitor, DooMenuBar, BLSpeech, HSTouch Server, WAF AB8SS, mcsTemperature, VWS, BLChart, RFXCOM, ISY Insteon, iAutomate RFID, iTunes, NetCAM, DSC Security, Nest

    #2
    You could set one of the BPVar to show the last few lines of the log.

    As an example, open up buildpage.vb and find a spare variable. They start at 51:
    PHP Code:
    'Variable 51 - Free

    Try
        StrVar=""
        Dim strLog As String = hs.LogGet()
        Dim lines() As String = strLog.Split(vbcrlf)
        Dim LinesToShow As Integer = 10
        Dim MaxLineLength As Integer = 100
        Dim Count As Integer
        Dim Result As String
        For Count = LinesToShow to 1 step -1 ' 
    use this line to show latest at the top
        
    'For Count  = 1 to LinesToShow ' use this line to show latest at the bottom
            Result 
    lines(lines.GetLength(0) - count-1)
            If 
    Result.Length MaxLineLength then Result=Mid(Result,1,MaxLineLength)
            
    strVar &= Result "<br>"
        
    Next
        hs
    .SaveVar ("BPVar51",strVar)
    Catch 
    ex As Exception
        
    If Logging=1 then hs.writelog("Jon00_Buildpage","Error at BPVar51 (" ex.Message ")")
    End Try 
    Jon

    Comment

    Working...
    X