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

Log to more file with more descriptive name #169

Open
MithicSpirit opened this issue Feb 10, 2022 · 1 comment
Open

Log to more file with more descriptive name #169

MithicSpirit opened this issue Feb 10, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@MithicSpirit
Copy link

/tmp/test is a hardcoded logfile which is quite non-descriptive. It would be nice if this was changed to something a bit clearer like /tmp/protonfixes.log, or maybe even make a proper temporary file with randomized unique prefix. The ideal solution would be to make the logfile configurable, but this might be a bit overkill.

@simons-public simons-public self-assigned this Feb 10, 2022
@simons-public simons-public added the enhancement New feature or request label Feb 10, 2022
@pchome
Copy link
Contributor

pchome commented Feb 19, 2022

I have a patch for a while for multi-user logs support

diff --git a/protonfixes/logger.py b/protonfixes/logger.py
index e0a3489..6d903c0 100644
--- a/protonfixes/logger.py
+++ b/protonfixes/logger.py
@@ -38,7 +38,8 @@ class Log():
         fulltext = color + pfx + str(msg) + reset + os.linesep
         sys.stderr.write(fulltext)
         sys.stderr.flush()
-        with io.open('/tmp/test', 'a', 1, encoding='utf-8') as testfile:
+        filename = '/tmp/'+ os.environ['USER'] +'-protonfixes-test'
+        with io.open(filename, 'a', 1, encoding='utf-8') as testfile:
             testfile.write(logtext)
 
 

so file names will be like /tmp/username-protonfixes-test, but looking into /tmp I see other programs usually put user name, user id or unique suffix at the end of file or directory name.
Similar change should be made for generated config files (dxvk). Also this configs is the reason why I decided to use current user name as a prefix (username-protonfixes-test,username-protonfixes_dxvk.conf, ...).

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

3 participants