You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Actually copy the log files to the path in the addon settings
96
+
Copy the provided Kodi log files into a timestamped destination folder under the configured addon destination.
97
+
98
+
Detailed behavior:
99
+
- Expects log_files as List[Tuple[str, str]] where `type` is e.g. 'log', 'oldlog', or 'crashlog' and `path` is the source filesystem path.
100
+
- Creates a destination directory at Store.destination_path named "<hostname>_Kodi_Logs_<YYYY-MM-DD_HH-MM-SS>".
101
+
- For entries with type 'log' or 'oldlog', reads the source, sanitises the content with clean_log() (because the log content may contain URLs with embedded user/password details), and writes the sanitised content to a file with the same basename in the destination folder.
102
+
- For other types (e.g., crash logs), copies the source file to the destination folder unchanged.
94
103
95
-
@param log_files: [] list of log files to copy
96
-
@return: None
104
+
Parameters:
105
+
log_files (List[Tuple[str, str]]): list of log descriptors [type, path] to copy.
106
+
107
+
Returns:
108
+
bool: True if files were successfully copied, False otherwise.
Run the log collection and copying flow: initialize this addon's logging, load configuration, gather Kodi log files, copy them to the configured destination, notify the user, and stop this addon's logging.
152
+
153
+
This function performs the module's main orchestration. It:
154
+
- Starts the logger for this addon's internal logging (not Kodi's general logging system) and loads addon configuration from settings.
155
+
- If no destination path is configured, shows an error notification and skips copying.
156
+
- Otherwise, notifies the user, gathers available log files, attempts to copy them to the configured destination, and notifies success (including number of files copied) or failure.
157
+
- Stops this addon's internal logging before returning.
158
+
159
+
Side effects: starts/stops this addon's internal logging, reads configuration, performs filesystem operations (reading, sanitizing, and copying log files), and shows user notifications. Returns None.
Load in the addon settings, at start or reload them if they have been changed
28
-
Log each setting as it is loaded
28
+
Load the addon's configuration from persistent settings.
29
+
30
+
Reads the 'log_path' setting and assigns it to Store.destination_path, then logs the resolved path (sanitized with clean_log because these paths may be URLs with embedded user/password details). This is called at startup and when settings are reloaded; it has no return value.
29
31
"""
30
32
Logger.info("Loading configuration from settings")
0 commit comments