Add DEBUG variable to control logging verbosity

This commit is contained in:
John Edwards 2025-02-09 19:36:21 +00:00
parent 2419f0741f
commit d9bea07841
3 changed files with 25 additions and 2 deletions

View file

@ -128,6 +128,14 @@ ds_workshop_changelevel $map_name
# Customizing this Container # Customizing this Container
## Debug Logging
If you want to increase the verbosity of log output set the `DEBUG` environment variable:
```dockerfile
DEBUG=0 (0=none, 1=steamcmd, 2=cs2, 3=all)
```
## Validating Game Files ## Validating Game Files
If you break the game through your customisations and want steamcmd to validate and redownload then set the `STEAMAPPVALIDATE` environment variable to `1`: If you break the game through your customisations and want steamcmd to validate and redownload then set the `STEAMAPPVALIDATE` environment variable to `1`:

View file

@ -1,17 +1,31 @@
#!/bin/bash #!/bin/bash
# Debug
## Steamcmd debugging
if [[ $DEBUG -eq 1 ]] || [[ $DEBUG -eq 3 ]]; then
STEAMCMD_SPEW="+set_spew_level 4 4"
fi
## CS2 server debugging
if [[ $DEBUG -eq 2 ]] || [[ $DEBUG -eq 3 ]]; then
CS2_LOG="on"
CS2_LOG_MONEY=1
CS2_LOG_DETAIL=3
CS2_LOG_ITEMS=1
fi
# Create App Dir # Create App Dir
mkdir -p "${STEAMAPPDIR}" || true mkdir -p "${STEAMAPPDIR}" || true
# Download Updates # Download Updates
if [[ "$STEAMAPPVALIDATE" -eq 1 ]]; then if [[ "$STEAMAPPVALIDATE" -eq 1 ]]; then
VALIDATE="validate" VALIDATE="validate"
else else
VALIDATE="" VALIDATE=""
fi fi
eval bash "${STEAMCMDDIR}/steamcmd.sh" +force_install_dir "${STEAMAPPDIR}" \ eval bash "${STEAMCMDDIR}/steamcmd.sh" "${STEAMCMD_SPEW}"\
+force_install_dir "${STEAMAPPDIR}" \
+@bClientTryRequestManifestWithoutCode 1 \ +@bClientTryRequestManifestWithoutCode 1 \
+login anonymous \ +login anonymous \
+app_update "${STEAMAPPID}" "${VALIDATE}"\ +app_update "${STEAMAPPID}" "${VALIDATE}"\

View file

@ -5,6 +5,7 @@ services:
environment: environment:
# Server configuration # Server configuration
- SRCDS_TOKEN # Game Server Token from https://steamcommunity.com/dev/managegameservers - SRCDS_TOKEN # Game Server Token from https://steamcommunity.com/dev/managegameservers
- DEBUG=0 # (0 - off, 1 - steamcmd, 2 - cs2, 3 - all)
- STEAMAPPVALIDATE=0 # (0 - no validation, 1 - enable validation) - STEAMAPPVALIDATE=0 # (0 - no validation, 1 - enable validation)
- CS2_SERVERNAME=changeme # (Set the visible name for your private server) - CS2_SERVERNAME=changeme # (Set the visible name for your private server)
- CS2_CHEATS=0 # (0 - disable cheats, 1 - enable cheats) - CS2_CHEATS=0 # (0 - disable cheats, 1 - enable cheats)