runtime/loglevels.py
author Andrey Skvortsov <andrej.skvortzov@gmail.com>
Thu, 07 Jun 2018 13:45:35 +0300
changeset 2173 976841968d74
parent 1973 cc7a46953471
permissions -rw-r--r--
Add retain basic implementation on GNU/Linux

Retain is saved in file and backup of this file is done every time.
File isn't saved on every PLC cycle to avoid high I/O load.
By default, retain is saved every second and on PLC stop/shutdown.
It's possible to override retain flush period by using CFLAGS option
in project's settings. For example, for 0.5 seconds period
use "-DFILE_RETAIN_SAVE_PERIOD_S=0.5".
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# See COPYING.Runtime file for copyrights details.

LogLevels = ["CRITICAL", "WARNING", "INFO", "DEBUG"]
LogLevelsCount = len(LogLevels)
LogLevelsDict = dict(zip(LogLevels, range(LogLevelsCount)))
LogLevelsDefault = LogLevelsDict["DEBUG"]