Log a message to the upgrade log
(msg, path, verbose=True, log_file='upgrade.log', end="\n")
| 50 | |
| 51 | |
| 52 | def log(msg, path, verbose=True, log_file='upgrade.log', end="\n"): |
| 53 | """ Log a message to the upgrade log """ |
| 54 | log_path = path / log_file |
| 55 | if not log_path.is_file(): |
| 56 | msg = f"""{msg} |
| 57 | |
| 58 | WARNING!! {log_path} doesn't exist, creating. |
| 59 | Do a `git add {log_path}` to track. |
| 60 | """ |
| 61 | if verbose: |
| 62 | print(msg, end=end) |
| 63 | with open(log_path, 'a', encoding='utf-8') as log_f: |
| 64 | log_f.write(f"{msg}{end}") |
| 65 | |
| 66 | def setup_args(): |
| 67 | """ Setup the common arguments """ |
no outgoing calls
no test coverage detected