mirror of https://github.com/databricks/cli.git
use proper loggers
This commit is contained in:
parent
116c513e15
commit
9e29462562
|
@ -1,5 +1,5 @@
|
|||
13:45:02 Info: start pid=73585 version=[DEV_VERSION] args="[CLI], telemetry, upload, --log-level=debug"
|
||||
13:45:02 Debug: POST /telemetry-ext
|
||||
HH:MM:SS Info: start pid=PID version=[DEV_VERSION] args="[CLI], telemetry, upload, --log-level=debug"
|
||||
HH:MM:SS Debug: POST /telemetry-ext
|
||||
> {
|
||||
> "items": null,
|
||||
> "protoLogs": [
|
||||
|
@ -12,11 +12,11 @@
|
|||
< {
|
||||
< "error_code": "ERROR_CODE",
|
||||
< "message": "Endpoint not implemented."
|
||||
< } pid=73585 sdk=true
|
||||
13:45:02 Debug: non-retriable error: Endpoint not implemented. pid=73585 sdk=true
|
||||
13:45:02 Warn: Attempt 0 failed due to a server side error. Retrying status code: 501
|
||||
pid=73585
|
||||
13:45:04 Debug: POST /telemetry-ext
|
||||
< } pid=PID sdk=true
|
||||
HH:MM:SS Debug: non-retriable error: Endpoint not implemented. pid=PID sdk=true
|
||||
HH:MM:SS Warn: Attempt 0 failed due to a server side error. Retrying status code: 501
|
||||
pid=PID
|
||||
HH:MM:SS Debug: POST /telemetry-ext
|
||||
> {
|
||||
> "items": null,
|
||||
> "protoLogs": [
|
||||
|
@ -29,11 +29,11 @@
|
|||
< {
|
||||
< "error_code": "ERROR_CODE",
|
||||
< "message": "Endpoint not implemented."
|
||||
< } pid=73585 sdk=true
|
||||
13:45:04 Debug: non-retriable error: Endpoint not implemented. pid=73585 sdk=true
|
||||
13:45:04 Warn: Attempt 1 failed due to a server side error. Retrying status code: 501
|
||||
pid=73585
|
||||
13:45:06 Debug: POST /telemetry-ext
|
||||
< } pid=PID sdk=true
|
||||
HH:MM:SS Debug: non-retriable error: Endpoint not implemented. pid=PID sdk=true
|
||||
HH:MM:SS Warn: Attempt 1 failed due to a server side error. Retrying status code: 501
|
||||
pid=PID
|
||||
HH:MM:SS Debug: POST /telemetry-ext
|
||||
> {
|
||||
> "items": null,
|
||||
> "protoLogs": [
|
||||
|
@ -46,8 +46,8 @@
|
|||
< {
|
||||
< "error_code": "ERROR_CODE",
|
||||
< "message": "Endpoint not implemented."
|
||||
< } pid=73585 sdk=true
|
||||
13:45:06 Debug: non-retriable error: Endpoint not implemented. pid=73585 sdk=true
|
||||
13:45:06 Warn: Attempt 2 failed due to a server side error. Retrying status code: 501
|
||||
pid=73585
|
||||
error: upload did not succeed after three attempts
|
||||
< } pid=PID sdk=true
|
||||
HH:MM:SS Debug: non-retriable error: Endpoint not implemented. pid=PID sdk=true
|
||||
HH:MM:SS Warn: Attempt 2 failed due to a server side error. Retrying status code: 501
|
||||
pid=PID
|
||||
HH:MM:SS Error: upload did not succeed after three attempts pid=PID
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
>>> [CLI] selftest send-telemetry --debug
|
||||
13:45:02 Info: start pid=73578 version=[DEV_VERSION] args="[CLI], selftest, send-telemetry, --debug"
|
||||
13:45:02 Info: completed execution pid=73578 exit_code=0
|
||||
HH:MM:SS Info: start pid=PID version=[DEV_VERSION] args="[CLI], selftest, send-telemetry, --debug"
|
||||
HH:MM:SS Info: completed execution pid=PID exit_code=0
|
||||
[wait_pid] process has ended
|
||||
|
|
|
@ -7,3 +7,11 @@ Response.Body = '''
|
|||
}
|
||||
'''
|
||||
Response.StatusCode = 501
|
||||
|
||||
[[Repls]]
|
||||
Old = "(?:[01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]"
|
||||
New = "HH:MM:SS"
|
||||
|
||||
[[Repls]]
|
||||
Old = "pid=[0-9]+"
|
||||
New = "pid=PID"
|
||||
|
|
|
@ -4,4 +4,4 @@ Warn: Attempt 1 failed due to a server side error. Retrying status code: 501
|
|||
|
||||
Warn: Attempt 2 failed due to a server side error. Retrying status code: 501
|
||||
|
||||
error: upload did not succeed after three attempts
|
||||
Error: upload did not succeed after three attempts
|
||||
|
|
|
@ -4,4 +4,4 @@ Warn: Attempt 1 was a partial success. Number of logs uploaded: 1 out of 2
|
|||
|
||||
Warn: Attempt 2 was a partial success. Number of logs uploaded: 1 out of 2
|
||||
|
||||
error: upload did not succeed after three attempts
|
||||
Error: upload did not succeed after three attempts
|
||||
|
|
|
@ -2,9 +2,10 @@ package telemetry
|
|||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/databricks/cli/libs/cmdio"
|
||||
"github.com/databricks/cli/libs/log"
|
||||
"github.com/databricks/cli/libs/telemetry"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
@ -22,15 +23,15 @@ func newTelemetryUpload() *cobra.Command {
|
|||
|
||||
resp, err := telemetry.Upload(ctx)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "error: %s\n", err)
|
||||
log.Error(ctx, err.Error())
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
fmt.Printf("Telemetry logs uploaded successfully\n")
|
||||
fmt.Println("Response:")
|
||||
cmdio.LogString(ctx, "Telemetry logs uploaded successfully")
|
||||
cmdio.LogString(ctx, "Response:")
|
||||
b, err := json.Marshal(resp)
|
||||
if err == nil {
|
||||
fmt.Println(string(b))
|
||||
cmdio.LogString(ctx, string(b))
|
||||
}
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue