EasyManua.ls Logo

Digi TransPort LR54 - Log Messages for Python Applications

Digi TransPort LR54
512 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Services and applications Python
Digi TransPort WR Routers User Guide
157
>>> datapoint.upload(“Emergency Door”, closed”, timestamp=time.time())
>>>
Once the datapoints have been uploaded to DRM, they can be viewed via DRM or accessed using Web
Services calls.
For more information on web services and datapoints, see the Digi Remote Manager Programmers
Guide.
Log messages for Python applications
To write log messages for Python applications to the event log of the TransPort device:
1. Use the standard Python syslog module to write messages from Python applications to the
event log. For example:
digi.router> python
Python 3.5.3
>>> import syslog
>>>
>>> syslog.syslog(syslog.LOG_ERR, “Error message from Python”)
>>> syslog.syslog(syslog.LOG_INFO, “Informational message from Python”)
2. Print the event log:
digi.router> show log
2018-07-16 07:36:29.103272 user.err python3_sb: Error message from Python
2018-07-16 07:36:30.447212 user.info python3_sb: Informational message from
Python

Table of Contents

Other manuals for Digi TransPort LR54

Related product manuals