Skip to content

Commit

Permalink
[StartEnigma] make twisted debug log path configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
henrylicious committed May 14, 2024
1 parent c9879b2 commit 411bc14
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/python/StartEnigma.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from os import chmod
from os import path as os_path
from os import system
from os import getenv
from sys import path as sys_path
from time import localtime, strftime, time

Expand Down Expand Up @@ -70,7 +71,7 @@ def setLoadUnlinkedUserbouquets(configElement):

config.misc.enabletwistedlog = ConfigYesNo(default=False)
if config.misc.enabletwistedlog.value == True:
log.startLogging(open('/home/root/logs/Enigma2-twisted.log', 'w'))
log.startLogging(open('%s/twisted.log' % getenv('LOGFOLDER'), 'w'))

profile("LOAD:Tools")
from Components.config import (ConfigInteger, ConfigSelection, ConfigText,
Expand Down
5 changes: 3 additions & 2 deletions tools/enigma2.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,19 @@ fi

export LC_CTYPE="en_US.UTF-8"

LOGFOLDER="/home/root/logs/"
export LOGFOLDER
if [ "$(grep -i config.crash.enabledebug=true /etc/enigma2/settings)" != "" ]; then
DEBUG_LVL='4'
RANDOMIZE1970=''
time=`date +%Y` ;
if [ "$time" = 1970 ]; then
RANDOMIZE1970="$(strings /dev/urandom | grep -o '[[:alnum:]]' | head -n 5 | tr -d '\n')"
fi
LOGFOLDER="/home/root/logs/"
if [ "$(grep config.crash.debug_path= /etc/enigma2/settings | sed 's/config.crash.debug_path=//g')" != "" -a -d "$(grep config.crash.debug_path= /etc/enigma2/settings | sed 's/config.crash.debug_path=//g')" ]; then
LOGFOLDER=$(grep config.crash.debug_path= /etc/enigma2/settings | sed 's/config.crash.debug_path=//g')
export LOGFOLDER
fi
export LOGFOLDER
LOGFILE=${LOGFOLDER}Enigma2-debug-$(date +%Y%m%d_%H-%M-%S)${RANDOMIZE1970}.log
if [ ! -d $LOGFOLDER ] ; then mkdir -p $LOGFOLDER; fi
ln -sf ${LOGFILE} ${LOGFOLDER}currlog
Expand Down

0 comments on commit 411bc14

Please sign in to comment.