2
0
mirror of https://github.com/spritsail/plex-media-server.git synced 2025-06-10 21:21:13 +00:00

Added log environment variables (#6)

* Added verbose env variables

- `LOG_DEBUG` or `LOG_VERBOSE` do not change anything it they are unset (same as before)
- `LOG_DEBUG` or `LOG_VERBOSE` take precedence on Plex configuration file at start when set to `0` or `1`. The user can change the Preferences once the container is started which will overwrite the environment variables.
This commit is contained in:
Quentin McGaw
2018-11-26 15:30:45 +02:00
committed by Adam Dodman
parent e283b21505
commit f9e4de3149
2 changed files with 22 additions and 0 deletions

View File

@ -51,6 +51,26 @@ if [ ! -e "\$PREF_FILE" ]; then
source gen-config.sh
fi
# Changes the log verbosity (Environment variable takes precedence on Plex Config)
if [ "$LOG_VERBOSE" = "1" ]; then
setPref "LogVerbose" "1"
elif [ "$LOG_VERBOSE" = "0" ]; then
setPref "LogVerbose" "0"
elif [ ! -z "$LOG_VERBOSE" ]; then
2>&1 echo -e "${RED}LOG_VERBOSE value '$LOG_VERBOSE' is invalid${RESET}"
exit 1
fi
# Changes the debug verbosity (Environment variable takes precedence on Plex Config)
if [ "$LOG_DEBUG" = "1" ]; then
setPref "logDebug" "1"
elif [ "$LOG_DEBUG" = "0" ]; then
setPref "logDebug" "0"
elif [ ! -z "$LOG_DEBUG" ]; then
2>&1 echo -e "${RED}LOG_DEBUG value '$LOG_DEBUG' is invalid${RESET}"
exit 1
fi
# Always attempt to claim an unclaimed server in case it was signed out
token="\$(getPref "PlexOnlineToken")"
if [ ! -z "\${PLEX_CLAIM}" ] && [ -z "\${token}" ]; then