Skip to content

Commit 35ef8f3

Browse files
committed
updated trace logs
1 parent d38dca9 commit 35ef8f3

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

README.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ EMPTY_TRASH=False
152152
CLEAN_BUNDLES=False
153153
OPTIMIZE_DB=False
154154
TRACE=False
155+
LOG_REQUESTS=False
155156
```
156157
157158
### Base Options
@@ -269,11 +270,18 @@ Sleep Timer between Empty Trash, Clean Bundles, and Optimize DB in seconds that'
269270
270271
#### Trace
271272
272-
Run with every request and file action logged.
273+
Run with extra trace logs.
273274
274275
* **Environment Variable:** `TRACE=True`
275276
* **Shell Command:** `-tr` or `--trace`
276277
278+
#### Log Requests
279+
280+
Run with every request and file action logged.
281+
282+
* **Environment Variable:** `LOG_REQUESTS=True`
283+
* **Shell Command:** `-lr` or `--log-requests`
284+
277285
### Continuous Schedule
278286
279287
Plex Image Cleanup can be run either immediately or on a schedule. The default behavior is to run immediately to run using a schedule simply pass in the `Schedule` Option.

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.9.14
1+
0.9.15

config/example.env

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ PHOTO_TRANSCODER=False
1313
EMPTY_TRASH=False
1414
CLEAN_BUNDLES=False
1515
OPTIMIZE_DB=False
16-
TRACE=False
16+
TRACE=False
17+
LOG_REQUESTS=False

plex_image_cleanup.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,15 @@ def not_failed(exception):
7070
{"arg": "et", "key": "empty-trash", "env": "EMPTY_TRASH", "type": "bool", "default": False, "help": "Global Toggle to Run Plex's Empty Trash Operation."},
7171
{"arg": "cb", "key": "clean-bundles", "env": "CLEAN_BUNDLES", "type": "bool", "default": False, "help": "Global Toggle to Run Plex's Clean Bundles Operation."},
7272
{"arg": "od", "key": "optimize-db", "env": "OPTIMIZE_DB", "type": "bool", "default": False, "help": "Global Toggle to Run Plex's Optimize DB Operation."},
73-
{"arg": "tr", "key": "trace", "env": "TRACE", "type": "bool", "default": False, "help": "Run with every request logged."}
73+
{"arg": "tr", "key": "trace", "env": "TRACE", "type": "bool", "default": False, "help": "Run with extra trace logs."},
74+
{"arg": "lr", "key": "log-requests", "env": "LOG_REQUESTS", "type": "bool", "default": False, "help": "Run with every request logged."}
7475
]
7576
script_name = "Plex Image Cleanup"
7677
plex_db_name = "com.plexapp.plugins.library.db"
7778
base_dir = os.path.dirname(os.path.abspath(__file__))
7879
config_dir = os.path.join(base_dir, "config")
7980
pmmargs = PMMArgs("meisnate12/Plex-Image-Cleanup", base_dir, options, use_nightly=False)
80-
logger = logging.PMMLogger(script_name, "plex_image_cleanup", os.path.join(config_dir, "logs"), discord_url=pmmargs["discord"], log_requests=pmmargs["trace"])
81+
logger = logging.PMMLogger(script_name, "plex_image_cleanup", os.path.join(config_dir, "logs"), discord_url=pmmargs["discord"], is_trace=pmmargs["trace"], log_requests=pmmargs["log-requests"])
8182
logger.secret([pmmargs["url"], pmmargs["discord"], pmmargs["token"], quote(str(pmmargs["url"])), requests.utils.urlparse(pmmargs["url"]).netloc])
8283
requests.Session.send = util.update_send(requests.Session.send, pmmargs["timeout"])
8384
plexapi.BASE_HEADERS["X-Plex-Client-Identifier"] = pmmargs.uuid

0 commit comments

Comments
 (0)