Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start the CLI daemon without the --log-format json #1544

Closed
3 tasks done
kittaakos opened this issue Oct 7, 2022 · 0 comments · Fixed by #1570
Closed
3 tasks done

Start the CLI daemon without the --log-format json #1544

kittaakos opened this issue Oct 7, 2022 · 0 comments · Fixed by #1570
Labels
topic: CLI Related to Arduino CLI topic: code Related to content of the project itself type: enhancement Proposed improvement

Comments

@kittaakos
Copy link
Contributor

kittaakos commented Oct 7, 2022

Describe the request

The daemon logging is essential in IDE2, but the JSON format adds an unnecessary computation; at least the JSON encoding phase is there. If this means only milliseconds of improvement, it will eventually add up.

Consider starting the daemon without the JSON log format.

diff --git a/arduino-ide-extension/src/node/arduino-daemon-impl.ts b/arduino-ide-extension/src/node/arduino-daemon-impl.ts
index f859985e..4a3ad882 100644
--- a/arduino-ide-extension/src/node/arduino-daemon-impl.ts
+++ b/arduino-ide-extension/src/node/arduino-daemon-impl.ts
@@ -162,8 +162,6 @@ export class ArduinoDaemonImpl
       '--config-file',
       `"${cliConfigPath}"`,
       '-v',
-      '--log-format',
-      'json',
     ];
     if (debug) {
       args.push('--debug');

With the proposed changes 👆, the daemon log output would be this:

time="2022-10-07T11:27:08+02:00" level=debug msg="Checking previous results for /Users/a.kitta/Library/Arduino15/packages/arduino/hardware/avr/1.8.5/cores/arduino/HardwareSerial1.cpp (result = /private/var/folders/z1/xkw1yh5n7rz4n8djprp1mdn80000gn/T/arduino-language-server2174793569/core/HardwareSerial1.cpp.o, dep = /private/var/folders/z1/xkw1yh5n7rz4n8djprp1mdn80000gn/T/arduino-language-server2174793569/core/HardwareSerial1.cpp.d)"

instead of this:

{"level":"debug","msg":"Checking previous results for /Users/a.kitta/Library/Arduino15/packages/arduino/hardware/avr/1.8.5/cores/arduino/HardwareSerial1.cpp (result = /private/var/folders/z1/xkw1yh5n7rz4n8djprp1mdn80000gn/T/arduino-language-server1238442199/core/HardwareSerial1.cpp.o, dep = /private/var/folders/z1/xkw1yh5n7rz4n8djprp1mdn80000gn/T/arduino-language-server1238442199/core/HardwareSerial1.cpp.d)","time":"2022-10-07T11:47:48+02:00"}

I believe both log formats are equally OK to consume, but the non-JSON one is cheaper.

Describe the current behavior

See the request description.

Arduino IDE version

1e269ac

Operating system

macOS

Operating system version

12.5.1

Additional context

No response

Issue checklist

  • I searched for previous requests in the issue tracker
  • I verified the feature was still missing when using the latest nightly build
  • My request contains all necessary details
@kittaakos kittaakos added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Oct 7, 2022
@per1234 per1234 added the topic: CLI Related to Arduino CLI label Oct 7, 2022
kittaakos pushed a commit that referenced this issue Oct 20, 2022
Closes #1544

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
kittaakos pushed a commit that referenced this issue Oct 24, 2022
Closes #1544

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: CLI Related to Arduino CLI topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants