(msg)
| 184 | |
| 185 | |
| 186 | def log(msg): |
| 187 | if isinstance(msg, bytes): |
| 188 | msg_str = msg.decode("utf-8", "replace") |
| 189 | msg_bytes = msg |
| 190 | else: |
| 191 | msg_str = msg |
| 192 | msg_bytes = msg.encode("utf-8", "replace") |
| 193 | |
| 194 | print("%s> %s" % (LOG_PREFIX[0], msg_str)) |
| 195 | |
| 196 | if LOG_FH[0]: |
| 197 | LOG_FH[0].write(msg_bytes + b"\n") |
| 198 | LOG_FH[0].flush() |
| 199 | |
| 200 | |
| 201 | def exec_and_log(args, cwd, env, exit_on_error=True): |
no outgoing calls
no test coverage detected