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

util: Use build target name as log file name #232

Merged
merged 1 commit into from
Nov 29, 2024
Merged
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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Please describe your issue as accurately as possible including expected and actu
### Log files

Please attach DXVK-NVAPI log files as a text file :
- When using Proton, set the Steam launch options for your game to `DXVK_NVAPI_LOG_PATH=/tmp/ DXVK_NVAPI_LOG_LEVEL=info %command%` and attach the corresponding `dxvk-nvapi.log` file in your `/tmp/` directory.
- When using Proton, set the Steam launch options for your game to `DXVK_NVAPI_LOG_PATH=/tmp/ DXVK_NVAPI_LOG_LEVEL=info %command%` and attach the corresponding `nvapi.log`/`nvapi64.log`/`nvofapi64.log` file in your `/tmp/` directory.
- See [Tweaks, debugging and troubleshooting](https://github.com/jp7677/dxvk-nvapi/blob/master/README.md#tweaks-debugging-and-troubleshooting) for general information.

Alternatively attach Proton logs as a text file:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ The following environment variables tweak DXVK-NVAPI's runtime behavior:
- `GA100` (Ampere)
- `AD100` (Ada)
- `DXVK_NVAPI_LOG_LEVEL` set to `info` prints log statements. The default behavior omits any logging. Please fill an issue if using log servery `info` creates log spam. Setting severity to `trace` logs all entry points enter and exits, this has a severe effect on performance. All other log levels will be interpreted as `none`.
- `DXVK_NVAPI_LOG_PATH` enables file logging additionally to console output and sets the path where the log file `dxvk-nvapi.log` should be written to. Log statements are appended to an existing file. Please remove this file once in a while to prevent excessive grow. This requires `DXVK_NVAPI_LOG_LEVEL` set to `info` or `trace`.
- `DXVK_NVAPI_LOG_PATH` enables file logging additionally to console output and sets the path where the log file `nvapi.log`/`nvapi64.log`/`nvofapi64.log` should be written to. Log statements are appended to an existing file. Please remove this file once in a while to prevent excessive grow. This requires `DXVK_NVAPI_LOG_LEVEL` set to `info` or `trace`.

Additionally, GitHub Actions provide build artifacts from different toolchains. In very rare situations a non-gcc build might provide better results.

Expand Down
5 changes: 2 additions & 3 deletions src/util/util_log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace dxvk::log {

constexpr auto logLevelEnvName = "DXVK_NVAPI_LOG_LEVEL";
constexpr auto logPathEnvName = "DXVK_NVAPI_LOG_PATH";
constexpr auto logFileName = "dxvk-nvapi.log";
constexpr auto logFileName = DXVK_NVAPI_TARGET_NAME ".log";

auto logLevel = env::getEnvVariable(logLevelEnvName);
if (logLevel != "info" && logLevel != "trace") {
Expand Down Expand Up @@ -81,8 +81,7 @@ namespace dxvk::log {
std::setfill('0'), std::setw(3), milliseconds, ":",
std::setfill('0'), std::setw(4), std::hex, ::GetCurrentProcessId(), ":",
std::setfill('0'), std::setw(4), std::hex, ::GetCurrentThreadId(), ":",
level, ":",
DXVK_NVAPI_TARGET_NAME, ":",
level, ":" DXVK_NVAPI_TARGET_NAME ":",
Copy link
Owner Author

@jp7677 jp7677 Nov 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had needed some time to get used to the idea ;)

message);

print(logMessage);
Expand Down
Loading