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

Logging: Improve warning message when writing to existing file #42

Open
jonshouse1 opened this issue Jul 18, 2021 · 4 comments
Open

Logging: Improve warning message when writing to existing file #42

jonshouse1 opened this issue Jul 18, 2021 · 4 comments

Comments

@jonshouse1
Copy link

Not sure if this is fixed but "Mint" seems to ship version 1.0.1 Jun 2019

Start gtkterm with some text being generated by a source.
Select, "log", "to file", specify name
Log some lines

$ cat log.txt | wc -l
55

Re-start gtkterm
Select "log", to file, specify name
"File already exists, replacing it will overwrite its contents"
Select "Replace"

$ cat log.txt | wc -l
68

Appended then, not overwritten.....

@Jeija
Copy link
Collaborator

Jeija commented Jul 25, 2021

Yes, log files are always appended to. I still think that the warning message makes sense the way it is currently expressed, because under Log->Clear GTKTerm also provides an option to erase the contents of the log file.

Feel free to comment / reopen the issue if you think that this behavior is not acceptable and have a proposal on how to fix it. To me, it seems like appending instead of overwriting certainly is the "safer" option.

@Jeija Jeija closed this as completed Jul 25, 2021
@jonshouse1
Copy link
Author

Sorry, I think you are simply wrong. Your own explanation shows you are wrong.

The dialogue box itself says "replace" .. the warning says "replacing it will overwrite its contents".... IE selecting replace will overwrite. Then it simply does not do what it describes.
I want that exact behaviour, I log the output of a device, each time I revise the code I want a clean log so I was initially confused when my new replaced log contained the old output.
Either the behaviour needs to be changed to match the description (my preferred option) or the text needs to be changed to properly describe the behaviour. If you where in marketing you could try and re-define the word replace to mean append, but that still would still be equally wrong ;-)

@Jeija
Copy link
Collaborator

Jeija commented Jul 25, 2021

Okay, I guess the best way to deal with this then is to simply change the warning message, which apparently can be done using the confirm-overwrite signal of GtkFileChooser: https://developer.gnome.org/gtk3/stable/GtkFileChooser.html#GtkFileChooser-confirm-overwrite
Because I think that the behavior (append by default) makes sense, the real problem is only the error message.

@Jeija Jeija reopened this Jul 25, 2021
@Jeija Jeija changed the title Bug with "log" (at least with what Linux Mint ship) Logging: Improve warning message when writing to existing file Jul 25, 2021
@jonshouse1
Copy link
Author

Because I think that the behavior (append by default) makes sense

But does it !
As a user I want to log one and only one session. If I wanted to keep data from multiple sessions I would simply change the log filename. At no point is it useful to me to have the log of one session appended to by another session.
A lot of the output I generate is very similar looking and not date time stamped so appending to the log simply causes confusion, at what point did the session change?, looking at the log output you may not be able to tell. In my case each session is modified code, so it really matters that the log is that session only.
Personally I find the current behaviour annoying and slows my workflow, I have to start gtkterm like this at the moment

$ rm -f log.txt;gtkterm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants