Skip to content

breaking: change app name and log path#934

Closed
ChungZH wants to merge 2 commits intocpeditor:v7.0from
ChungZH:master
Closed

breaking: change app name and log path#934
ChungZH wants to merge 2 commits intocpeditor:v7.0from
ChungZH:master

Conversation

@ChungZH
Copy link
Copy Markdown
Member

@ChungZH ChungZH commented Jul 18, 2021

Description

Change the log from /tmp/cpeditorLogFiles to ~/.cache/cpeditor/log.

Use QStandardPaths::CacheLocation.

Also change the appname from CP Editor to cpeditor.

Related Issues / Pull Requests

close #926

Motivation and Context

How Has This Been Tested?

Archlinux.

Screenshots (if appropriate)

2021-07-18_21-37

Checklist

  • If the key of a setting is changed, the old attribute is updated or it is resolved in SettingsUpdater.
  • If there are changes of the text displayed in the UI, they are wrapped in tr() or QCoreApplication::translate().
  • If needed, I have opened a pull request or an issue to update the documentation.
  • If these changes are notable, they are documented in CHANGELOG.md.

Additional text

@coder3101 coder3101 added this to the v7.0 milestone Jul 18, 2021
neko-para
neko-para previously approved these changes Jul 18, 2021
@ouuan
Copy link
Copy Markdown
Member

ouuan commented Jul 18, 2021

I think we can merge breaking changes into a v7.0 branch.

@coder3101
Copy link
Copy Markdown
Member

Since the path ~/.cache/location/cpeditor/log is only used by cpeditor and the location itself means that it should contain logs of cpeditor.

In the name of log file cpeditor-*.log is cpeditor prefix required anymore?

We can better organise the log files by pushing them in a subdirectory by date. The log file can have a format hh-mm-ss-tzz-instance.log and we can delete the last 5 days or 10 days of log by subdirectory name instead of individual logs.

@coder3101
Copy link
Copy Markdown
Member

I think we can merge breaking changes into a v7.0 branch.

Agree.

All PR targetting project "CP Editor 7.0" should go there.

@ouuan
Copy link
Copy Markdown
Member

ouuan commented Jul 18, 2021

Since the path ~/.cache/location/cpeditor/log is only used by cpeditor and the location itself means that it should contain logs of cpeditor.

In the name of log file cpeditor-*.log is cpeditor prefix required anymore?

👍

We can better organise the log files by pushing them in a subdirectory by date. The log file can have a format hh-mm-ss-tzz-instance.log and we can delete the last 5 days or 10 days of log by subdirectory name instead of individual logs.

I doubt whether this would be helpful 🤔 There aren't many log files so this can't significantly make it easier to navigate to a log file by date, but it does make it harder to navigate between log files. Neither of these two actions (find log file by date / navigate between log files) happens very often, though.

@ouuan
Copy link
Copy Markdown
Member

ouuan commented Jul 18, 2021

And it's harder to keep 50 log files if they are in different folders. Then we can only keep log files in several days. However, if they are in the same folder, it is still easy to keep log files in several days.

@ouuan ouuan changed the title chore: change the log path chore: change app name and log path Jul 18, 2021
@ouuan ouuan changed the title chore: change app name and log path breaking: change app name and log path Jul 18, 2021
@ouuan ouuan changed the base branch from master to v7.0 July 18, 2021 14:26
@ouuan ouuan dismissed neko-para’s stale review July 18, 2021 14:26

The base branch was changed.

@coder3101
Copy link
Copy Markdown
Member

coder3101 commented Jul 18, 2021

And it's harder to keep 50 log files if they are in different folders. Then we can only keep log files in several days. However, if they are in the same folder, it is still easy to keep log files in several days.

I agree. We can keep it in the same top level directory but I still believe instead of deleting log files when it reaches 50, we should keep last 7 days of logs or 14 days.

If someone use app say 5 days a week, we end up with logs as old as 2 months. At the same time if we are developing cpeditor, in just a few days we can create 50 files.

So it will be better if everytime we create new log file we delete all logs older than 7 or 14 days.

@coder3101
Copy link
Copy Markdown
Member

Close #925 too?

Not in the current code. If you wish you can do the changes and link that issue as well.

@ChungZH
Copy link
Copy Markdown
Member Author

ChungZH commented Jul 18, 2021

Close #925 too?

Not in the current code. If you wish you can do the changes and link that issue as well.

I'm afraid I'm too poor to do that 😹

@coder3101
Copy link
Copy Markdown
Member

Close #925 too?

Not in the current code. If you wish you can do the changes and link that issue as well.

I'm afraid I'm too poor to do that 😹

Ok. Is changing name inside SingleApplication::setApplicationName() required for this log PR?

If not, undo that change and change title to breaking: change log path and delete logs by date

@neko-para
Copy link
Copy Markdown
Contributor

I think it does require it 🤔
As It influences, you have to change it you want it to work fine.

@ChungZH
Copy link
Copy Markdown
Member Author

ChungZH commented Jul 18, 2021

Close #925 too?也关闭925号?

Not in the current code. If you wish you can do the changes and link that issue as well.当前代码中没有。如果您希望您可以进行更改并链接该问题。

I'm afraid I'm too poor to do that 😹恐怕我太穷了,做不到这一点

Ok. Is changing name inside SingleApplication::setApplicationName() required for this log PR?

If not, undo that change and change title to breaking: change log path and delete logs by date

image

If I don't change name, the log path will be ~/.cache/CP Editor/log

@ChungZH
Copy link
Copy Markdown
Member Author

ChungZH commented Jul 18, 2021

I think the name can be changed in the future. Because we have to change the name in v7.

@neko-para
Copy link
Copy Markdown
Contributor

Yes, maybe ignoring that is a good choice. That should be fixed in changing name pr.

@coder3101
Copy link
Copy Markdown
Member

Yes, maybe ignoring that is a good choice. That should be fixed in changing name pr.

Okay, is #925 waiting on some other PR? Can you propose a PR for it since you and ouuan handle settings related stuff. We can first merge your PR for #925 then merge this PR

@neko-para
Copy link
Copy Markdown
Contributor

I don't think that #925 is blocked by any PR. @ouuan Do you know some infomation? The settings refactor branch handled by me isn't related to this.

@neko-para
Copy link
Copy Markdown
Contributor

As this branch refers the app name by qt, it's ok to just merge this. There won't be a patch for this neither.

@ouuan
Copy link
Copy Markdown
Member

ouuan commented Jul 19, 2021

Okay, is #925 waiting on some other PR? Can you propose a PR for it since you and ouuan handle settings related stuff. We can first merge your PR for #925 then merge this PR

I don't understand. What does "an issue waits for a PR" mean?

@ouuan
Copy link
Copy Markdown
Member

ouuan commented Jul 19, 2021

I don't see any problem to change the app name here. And I don't understand your conversation very well 🤔 What's the problem here? Are you discussing whether #925 should be closed by this or something else?

@coder3101
Copy link
Copy Markdown
Member

I don't see any problem to change the app name here. And I don't understand your conversation very well 🤔 What's the problem here? Are you discussing whether #925 should be closed by this or something else?

I am in favour of changing name here. OP say he cannot fix 925 in this PR but this PR requires that app name (Qt app name) should be changed. App name is used to find the cache directory.

@coder3101
Copy link
Copy Markdown
Member

What we were discussing is that since this PR requires app name to be changed, instead of partially changing it, we can either

  1. Completely fix Change the AppName from "CP Editor" to "cpeditor" #925 in this PR
  2. Propose and merge a PR for Change the AppName from "CP Editor" to "cpeditor" #925 then merge this.

I think the change of app name should be done first in the v7.0 so that all following PR are created against new app name.

@coder3101
Copy link
Copy Markdown
Member

@neko-para was asking what changes should done to fix #925?

@coder3101
Copy link
Copy Markdown
Member

coder3101 commented Jul 19, 2021

a PR waiting for another PR/issue

It means PR A should be merged before PR B can be merged. Since PR B requires some changes that are in PR A.

If PR A is not opened, consider it's issue to be fixed instead.

@ouuan
Copy link
Copy Markdown
Member

ouuan commented Jul 19, 2021

OK, I understand the problem. The biggest problem is that without changes to the settings, the old settings won't be moved, and #925 won't be finished. We can wait for #858 to merge #934.

@coder3101
Copy link
Copy Markdown
Member

Does #858 fixes #925? Or another PR to fix #925 will be created after #858 is merged?

@ouuan
Copy link
Copy Markdown
Member

ouuan commented Jul 19, 2021

Does #858 fixes #925?

Yes.

@coder3101
Copy link
Copy Markdown
Member

Does #858 fixes #925?

Yes.

@neko-para you should link that issue to the PR.

@stale
Copy link
Copy Markdown

stale bot commented Aug 18, 2021

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Inactive issues label Aug 18, 2021
@coder3101 coder3101 removed the stale Inactive issues label Aug 18, 2021
@ouuan ouuan added the work in progress The work has been started and is in progress. label Aug 18, 2021
@ouuan ouuan mentioned this pull request Feb 13, 2024
2 tasks
@ouuan ouuan closed this Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

work in progress The work has been started and is in progress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change the log from /tmp/cpeditorLogFiles to ~/.cache/cpeditor/log

4 participants