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

logs with xtf file instead of temp folder #77

Closed
sjib opened this issue Sep 6, 2022 · 10 comments
Closed

logs with xtf file instead of temp folder #77

sjib opened this issue Sep 6, 2022 · 10 comments
Assignees
Labels
enhancement New feature or request

Comments

@sjib
Copy link
Contributor

sjib commented Sep 6, 2022

Currently the logs are stored in the temp folder, as it usually has access rights for writing

In virtual environments reading the files is not possible as @urskaufmann mentioned.

qgepqwat2ili_logs

Suggestion:
Change folder to xtf folder and name the logs as xtfname.*.log

Question:
What happens if I export the xtf a second time with the same name? Overwrite old logs?

@sjib sjib added the enhancement New feature or request label Sep 6, 2022
@urskaufmann
Copy link

Precision: it's not "not possible to read". But the button "show logs" has not an adress that works in the virtual environment (we have no access to c: )

@sjib
Copy link
Contributor Author

sjib commented Sep 6, 2022

@urskaufmann So even a tool tip with the file path would not help to access it manually, right?

@urskaufmann
Copy link

The path of the log-files is C:\Users\KAU\AppData\Local\Temp\qgepqwat2ili
AppData is hidden and not shown even if I check Ausgeblendete Elemente in the file explorer. I have to use a detour to have access to this place.

@ponceta
Copy link
Member

ponceta commented Sep 7, 2022

Windows + E and copy paste the URL

What I got is :

  • Add a checkbox to export full logs in the same repo as the export

Is there a possibility to create an URL directly to the destination file in the success message ?
file://C:\mypath\my_interlis_generated_file.xtf

@sjib
Copy link
Contributor Author

sjib commented Sep 7, 2022

A second button could be added in the success bar:

def _show_results(title, message, log_path, level):

button2 = QPushButton(widget)
button2.setText("Show export file")
button.pressed.connect(lambda p=file_name: webbrowser.open(p))
widget.layout().addWidget(button)

Documentation can be found here https://docs.qgis.org/3.22/en/docs/pyqgis_developer_cookbook/communicating.html

@sjib
Copy link
Contributor Author

sjib commented Sep 7, 2022

Or even easier if it is possible to make {file_name} a hyperlink:

f"Data successfully exported to {file_name}",

@sjib
Copy link
Contributor Author

sjib commented Sep 7, 2022

The log_path can be (easily?) adjusted in adding the file name directory path (export directory) as next_to_path in the function make_log_path

def make_log_path(next_to_path, step_name):

"""Returns a path for logging purposes. If next_to_path is None, it will be saved in the temp directory"""

All calls of make_log_path would have to be adjusted from eg.
filename = make_log_path(None, "qgepqwat2ili")
to
filename = make_log_path("next_to_path", "qgepqwat2ili")

@ponceta
Copy link
Member

ponceta commented Oct 11, 2022

@olivierdalang propose a way to :

  • Add a checkbox to export full logs in the same repo as the export

@sjib
Copy link
Contributor Author

sjib commented Nov 7, 2022

WIP Pull request by OD: add ability to save logs next to input/output file in the GUI

Suggested implementation of the checkbox:
gui_export_logs_option ui

@olivierdalang
Copy link
Collaborator

merged in QGEP/qgepplugin#71

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants