| 145 | @_user_agrees_to_telemetry |
| 146 | @decorators.suppress_all_exceptions(raise_in_diagnostics=True) |
| 147 | def output_payload_to_file(payload): |
| 148 | if payload: |
| 149 | config_dir = os.path.dirname(config.config_location()) |
| 150 | telemetry_file_path = os.path.join(config_dir, MSSQL_CLI_TELEMETRY_FILE) |
| 151 | |
| 152 | # Telemetry log file will only contain data points from the most recent session. |
| 153 | with open(telemetry_file_path, "w+") as telemetry_file: |
| 154 | json.dump(json.loads(payload), telemetry_file, indent=2) |
| 155 | |
| 156 | |
| 157 | @decorators.suppress_all_exceptions(raise_in_diagnostics=True) |