Commit 4d1b0f6
authored
[DECO-228] Format output logs and also output to a file (#153)
Also setup basic vscode settings options for log length etc
## Truncation Depth = 2
```js
{
logger: 'SDK',
operationId: 'cf9f7fd8-bb44-446b-a694-76c9477b44db',
operationName: 'ClustersService.list',
loggingFunction: 'ApiClient.request',
timestamp: '11/2/2022, 11:51:42 PM',
request: { method: 'GET' },
response: {
clusters: '[{"cluster_id":"1017-064207-v53fc7dm","c ...(31937 bytes more)'
},
level: 'debug',
message: 'https://adb-309687753508875.15.azuredatabricks.net/api/2.0/clusters/list?can_use_client='
}
```
## Truncation Depth = 3
```js
{
logger: 'SDK',
operationId: '2e97c02c-f8da-4bcb-8cfc-bfba71b1fe47',
operationName: 'ClustersService.list',
loggingFunction: 'ApiClient.request',
timestamp: '11/2/2022, 11:54:11 PM',
request: { method: 'GET' },
response: {
clusters: [
'{"cluster_id":"1017-064207-v53fc7dm","cr ...(1310 bytes more)',
'{"cluster_id":"0818-155213-scc3x4dj","cr ...(1329 bytes more)',
'...20 more items'
]
},
level: 'debug',
message: 'https://adb-309687753508875.15.azuredatabricks.net/api/2.0/clusters/list?can_use_client='
}
```
## Truncation Depth = 4
```js
{
logger: "SDK",
operationId: "5a670a2c-dd12-4b95-8390-76bd727452e1",
operationName: "ClustersService.list",
loggingFunction: "ApiClient.request",
timestamp: "11/2/2022, 11:54:42 PM",
request: { method: "GET" },
response: {
clusters: [
{
cluster_id: "1017-064207-v53fc7dm",
creator_user_name: "61b77d30-bc10-4214-9650-29cf5db0e941",
spark_context_id: "4923128785231340000",
cluster_name: "sdk-go-cluster-heabciilbkij",
spark_version: "10.4.x-scala2.12",
spark_conf:
'{"spark.databricks.delta.preview.enabled ...(9 bytes more)',
azure_attributes:
'{"first_on_demand":1,"availability":"ON_ ...(38 bytes more)',
node_type_id: "Standard_F4",
driver_node_type_id: "Standard_F4",
autotermination_minutes: "10",
enable_elastic_disk: "true",
disk_spec: "{}",
cluster_source: "UI",
enable_local_disk_encryption: "false",
instance_source: '{"node_type_id":"Standard_F4"}',
driver_instance_source: '{"node_type_id":"Standard_F4"}',
effective_spark_version: "10.4.x-scala2.12",
state: "TERMINATED",
state_message:
"Inactive cluster terminated (inactive fo ...(14 bytes more)",
start_time: "1665988927301",
terminated_time: "1665989855187",
last_state_loss_time: "1665989248506",
last_activity_time: "1665989229258",
last_restarted_time: "1665989248621",
num_workers: "2",
default_tags:
'{"Vendor":"Databricks","Creator":"61b77d ...(159 bytes more)',
termination_reason:
'{"code":"INACTIVITY","type":"SUCCESS","p ...(44 bytes more)',
init_scripts_safe_mode: "false",
},
{
cluster_id: "0818-155213-scc3x4dj",
creator_user_name: "serge.smertin@databricks.com",
spark_context_id: "6399405132010977000",
cluster_name: "Default Test Cluster",
spark_version: "11.3.x-scala2.12",
spark_conf:
'{"spark.databricks.delta.preview.enabled ...(9 bytes more)',
azure_attributes:
'{"first_on_demand":1,"availability":"ON_ ...(38 bytes more)',
node_type_id: "Standard_L8as_v3",
driver_node_type_id: "Standard_DS3_v2",
autotermination_minutes: "60",
enable_elastic_disk: "true",
disk_spec: "{}",
cluster_source: "UI",
enable_local_disk_encryption: "false",
instance_source: '{"node_type_id":"Standard_L8as_v3"}',
driver_instance_source: '{"node_type_id":"Standard_DS3_v2"}',
effective_spark_version: "11.3.x-scala2.12",
state: "TERMINATED",
state_message:
"Inactive cluster terminated (inactive fo ...(14 bytes more)",
start_time: "1660837933746",
terminated_time: "1667412178375",
last_state_loss_time: "1667408387771",
last_activity_time: "1667408547018",
last_restarted_time: "1667408387822",
autoscale: '{"min_workers":1,"max_workers":50}',
default_tags:
'{"Vendor":"Databricks","Creator":"serge. ...(144 bytes more)',
termination_reason:
'{"code":"INACTIVITY","type":"SUCCESS","p ...(44 bytes more)',
init_scripts_safe_mode: "false",
},
"...20 more items",
],
},
level: "debug",
message:
"https://adb-309687753508875.15.azuredatabricks.net/api/2.0/clusters/list?can_use_client=",
}
```
<img width="820" alt="Screenshot 2022-11-03 at 16 51 02"
src="https://user-images.githubusercontent.com/88345179/199708342-c876310e-1493-485a-946e-78c238682cc6.png">1 parent 58690e0 commit 4d1b0f6
10 files changed
Lines changed: 198 additions & 48 deletions
File tree
- packages
- databricks-sdk-js/src
- logging
- databricks-vscode-types
- databricks-vscode
- src
- logger
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 18 | + | |
23 | 19 | | |
24 | 20 | | |
25 | 21 | | |
26 | 22 | | |
27 | 23 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | 24 | | |
35 | 25 | | |
36 | | - | |
37 | 26 | | |
38 | | - | |
| 27 | + | |
39 | 28 | | |
40 | | - | |
41 | 29 | | |
42 | | - | |
| 30 | + | |
43 | 31 | | |
44 | 32 | | |
45 | 33 | | |
| |||
49 | 37 | | |
50 | 38 | | |
51 | 39 | | |
52 | | - | |
| 40 | + | |
53 | 41 | | |
54 | 42 | | |
55 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
| |||
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | 34 | | |
47 | 35 | | |
48 | 36 | | |
| |||
97 | 85 | | |
98 | 86 | | |
99 | 87 | | |
100 | | - | |
101 | | - | |
| 88 | + | |
102 | 89 | | |
103 | 90 | | |
104 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
487 | 487 | | |
488 | 488 | | |
489 | 489 | | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
490 | 521 | | |
491 | 522 | | |
492 | 523 | | |
| |||
517 | 548 | | |
518 | 549 | | |
519 | 550 | | |
| 551 | + | |
520 | 552 | | |
521 | | - | |
| 553 | + | |
| 554 | + | |
522 | 555 | | |
523 | 556 | | |
524 | 557 | | |
| |||
565 | 598 | | |
566 | 599 | | |
567 | 600 | | |
568 | | - | |
| 601 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
Lines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | | - | |
17 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
18 | 30 | | |
19 | 31 | | |
20 | 32 | | |
| |||
23 | 35 | | |
24 | 36 | | |
25 | 37 | | |
26 | | - | |
27 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
28 | 42 | | |
29 | 43 | | |
30 | 44 | | |
| |||
42 | 56 | | |
43 | 57 | | |
44 | 58 | | |
45 | | - | |
46 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
47 | 63 | | |
48 | 64 | | |
49 | 65 | | |
| |||
Lines changed: 85 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
778 | 778 | | |
779 | 779 | | |
780 | 780 | | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
781 | 788 | | |
782 | 789 | | |
783 | 790 | | |
| |||
1854 | 1861 | | |
1855 | 1862 | | |
1856 | 1863 | | |
| 1864 | + | |
1857 | 1865 | | |
1858 | 1866 | | |
1859 | 1867 | | |
| |||
1869 | 1877 | | |
1870 | 1878 | | |
1871 | 1879 | | |
| 1880 | + | |
1872 | 1881 | | |
1873 | 1882 | | |
1874 | 1883 | | |
| |||
0 commit comments