Skip to content

[breaking] daemon --debug-file will overwrite the log file instead of appending to it #1773

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cli/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func NewCommand() *cobra.Command {
configuration.Settings.BindPFlag("daemon.port", daemonCommand.PersistentFlags().Lookup("port"))
daemonCommand.Flags().BoolVar(&daemonize, "daemonize", false, tr("Do not terminate daemon process if the parent process dies"))
daemonCommand.Flags().BoolVar(&debug, "debug", false, tr("Enable debug logging of gRPC calls"))
daemonCommand.Flags().StringVar(&debugFile, "debug-file", "", tr("Append debug logging to the specified file"))
daemonCommand.Flags().StringVar(&debugFile, "debug-file", "", tr("Log to the specified file, the file will be overwritten"))
daemonCommand.Flags().StringSliceVar(&debugFilters, "debug-filter", []string{}, tr("Display only the provided gRPC calls"))
return daemonCommand
}
Expand All @@ -84,7 +84,7 @@ func runDaemonCommand(cmd *cobra.Command, args []string) {
if debug {
if debugFile != "" {
outFile := paths.New(debugFile)
f, err := outFile.Append()
f, err := outFile.Create()
if err != nil {
feedback.Error(tr("Error opening debug logging file: %s", err))
os.Exit(errorcodes.ErrBadCall)
Expand Down
8 changes: 8 additions & 0 deletions docs/UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

Here you can find a list of migration guides to handle breaking changes between releases of the CLI.

## 0.24.0

### The flag `--debug-file path` in `daemon` command now overwrites the file instead of appending.

Previously running the Arduino CLI in deamon mode with the flag `--debug-file log.txt` will append to `log.txt`, now the
file is overwritten. Since the amount of log produced is very high this will help to keep the log size on a reasonable
amount if the flag is left enabled.

## 0.23.0

### Arduino IDE builtin libraries are now excluded from the build when running `arduino-cli` standalone
Expand Down