Tag Logs

<%include file="/pageheader.html"/> <%! from kaithem.src import tagpoints,unitsofmeasure,util,auth,pages import time import gc import collections import dateutil.parser import datetime import pytz def combineLogs(a): op = [] for i in a: for j in a[i]: if isinstance(j[0],str): op.append((j[0],unitsofmeasure.strftime(datetime.datetime.fromisoformat(j[0]).timestamp()),i,j[1])) else: op.append((j[0],unitsofmeasure.strftime(j[0]),i,j[1])) return sorted(op) %> <% tz=pytz.timezone(auth.getUserSetting(pages.getAcessingUser(),'timezone')) logtime=time.time()-3600 if data and 'logtime' in data: logtime = tz.localize(dateutil.parser.parse(data['logtime'])).timestamp() if tagName in tagpoints.allTags: tag=tagpoints.allTags[tagName]() else: raise ValueError("No such tag") %>

# Tag Point: ${tag.name}

This page show logs for one tag.
%if hasattr(tag, 'configLoggers'):

### Recent Log Data from ${unitsofmeasure.strftime(logtime)}

All times use the time zone and format from your user settings. Very recent data may be shown, but data is buffered to disk for 10 minutes. Saving the server state flushes all data to disk.

#### Export Data

Starting Time: Max Values: Export As:
Data to export:

#### Goto

Time | Type | Val
--- | --- | ---
%if isinstance(tag,tagpoints.NumericTagPointClass): %for i in combineLogs({tag.configLoggers[i].accumType:tag.configLoggers[i].getRecent(logtime, time.time(), 1000) for i in tag.configLoggers}):
${i[1]} | ${i[2]} %if i[3]>tag.hi or i[3]${i[3]} %else: | ${i[3]} %endif
%endfor %else: %for i in combineLogs({tag.configLoggers[i].accumType:tag.configLoggers[i].getRecent(logtime, time.time(), 1000) for i in tag.configLoggers}):
${i[1]} | ${i[2]} | ${i[3][:128]}
%endfor %endif

%endif
<%include file="/pagefooter.html"/>