runtime/loglevels.py
author Edouard Tisserant <edouard@beremiz.fr>
Fri, 07 Feb 2025 10:52:09 +0100 (2 months ago)
changeset 4104 9e59bb5ad9e1
parent 1973 cc7a46953471
permissions -rw-r--r--
Python runtime: call "OnIdle" tasks when py_eval FBs execution queue is empty.

This is usefull to execute slow operations that can be deffered from functions called by py_eval FBs.
User python code add a callable to "OnIdle" list made available in global scope.
#!/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"]