Add print for log debug

This commit is contained in:
Luc VOISE 2020-10-16 17:20:09 +02:00
parent 7e02c0ad78
commit 34c71dce65
1 changed files with 4 additions and 3 deletions

View File

@ -138,17 +138,18 @@ def main():
print("Manual server choice : ID = " + SERVER_ID) print("Manual server choice : ID = " + SERVER_ID)
if speedtest.returncode == 0: # Speedtest was successful. if speedtest.returncode == 0: # Speedtest was successful.
data = format_for_influx(speedtest.stdout) data = format_for_influx(speedtest.stdout)
print("Speedtest Successful:") print("Speedtest Successful :")
print(speedtest.stdout)
if influxdb_client.write_points(data) == True: if influxdb_client.write_points(data) == True:
print("Data written to DB successfully") print("Data written to DB successfully")
time.sleep(TEST_INTERVAL) time.sleep(TEST_INTERVAL)
else: # Speedtest failed. else: # Speedtest failed.
print("Speedtest Failed:") print("Speedtest Failed :")
print(speedtest.stderr) print(speedtest.stderr)
print(speedtest.stdout) print(speedtest.stdout)
time.sleep(TEST_FAIL_INTERVAL) time.sleep(TEST_FAIL_INTERVAL)
if __name__ == '__main__': if __name__ == '__main__':
print('Speedtest CLI Data Logger to InfluxDB') print('Speedtest CLI data logger to InfluxDB started...')
main() main()