automatic-ripping-machine/scripts/docker
xieve 9850e69037
[BUGFIX] Refactor logging & exception handling (#1696)
* refactor: use ProcessHandler instead of subprocess.run

* fix(logger): consistency, versatility and formatting

Before:

	[2026-02-06 18:40:20] DEBUG ARM: Class.method <message>

After:

	2026-02-08 10:18:08 ARM: DEBUG: Class.method: <message>

- stdout now uses short formatting (eg. for journald, which timestamps stdout)
- Handling of debug level formatting is more consistent now
- Removed `clean_loggers()`:
	- This function wasn't really doing what it said it was, since it was only removing at most one handler. Instead, I opted to only remove FileHandlers, such that if a more specific log file is created, the messages are not also logged to arm.log, but they are still logged to stdout and syslog.

* fix(logger): crash because of empty label

* feat(ripper.main): --no-syslog argument

Some containers don't have or need a syslog

* fix(ripper.main): log level of critical errors

* fix(ripper.main): handle errors during setup

* fix(ripper.main): handle SIGTERM

* refactor(ripper.utils.arm_setup): simplify log setup

* fix(ripper.utils.arm_setup): create logs/progress folder

* refactor(ripper.utils): always use RipperException to bail

Replaces all bare Exceptions and all sys.exit() calls with
RipperExceptions.

- more consistent error handling
- simplified make_dir helper function
- removed try-catch where we were calling sys.exit() anyways

* fix: remove UNIDENTIFIED_EJECT

Closes automatic-ripping-machine/automatic-ripping-machine#1360

UNIDENTIFIED_EJECT is not necessary anymore, since the ripper will now
always eject at the end (if AUTO_EJECT is set), even if an error is
thrown, so we can do away with the unreliable pre-check entirely and
rest assured that the ripper itself is much more capable of correctly
identifying whether a disc is rippable or not.

* fix: joblength should be 0 if it didn't start

* refactor(logger): deduplicated timestamp-filename logic

* fix(ripper): allow ripping of discs with no label

* fix(ripper.makemkv): missing attribute

* feat(ProcessHandler): capture stderr

* chore(ripper): remove unused imports and variables

* fix(ProcessHandler): type issues

* Bump version from 2.21.5 to 2.22.1

---------

Co-authored-by: Mtech <62650032+microtechno9000@users.noreply.github.com>
2026-02-17 22:02:44 +10:30
..
runit [BUGFIX] UI Progress Bar and Old ARM Version Removal (#1414) 2025-07-01 22:04:51 +09:30
runsv Squashed commit of the following: 2022-07-04 23:16:36 +01:00
custom_udev Squashed commit of the following: 2022-07-04 23:16:36 +01:00
docker_arm_wrapper.sh [BUGFIX] Refactor logging & exception handling (#1696) 2026-02-17 22:02:44 +10:30
start_arm_container.sh [BUGFIX] added timezone env variable to start_arm_container.sh (#1369) 2025-04-21 21:00:37 +09:30