Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

[Visual Studio and vcpkg] Logger unable to open log file "k4a.log" #1987

Open
bas1l opened this issue Aug 15, 2024 · 0 comments
Open

[Visual Studio and vcpkg] Logger unable to open log file "k4a.log" #1987

bas1l opened this issue Aug 15, 2024 · 0 comments
Labels
Bug Something isn't working Code Sample This issue is related to a code sample Triage Needed The Issue still needs to be reviewed by Azure Kinect team members.

Comments

@bas1l
Copy link

bas1l commented Aug 15, 2024

Hey,

Thank you in advance for your time and help!

Describe the bug
I use Visual Studio and installed the SDK with the embedded vcpkg in manifest mode.
When trying to get a frame of my .mkv Kinect video using the k4a_playback_get_next_capture function, an exception occurs. It seems to be related to log files (The message <Logger unable to open log file "k4a.log"> appears in the terminal).

More detail
  • The issue occurs regardless of whether the log environment variables are set to 0 or a specific location (both absolute and relative paths). When set to a specific location, both k4a and k4a_recorder log files are created. The k4a_recorder log file contains some content ("New logging session started"), but the k4a log file triggers an exception (Microsoft C++ exception: spdlog::spdlog_ex).
  • In Debug mode (when not using the compiled .exe), I can bypass the exception by clicking the "Continue" button. After ignoring the exception, I can read all the frames of the video without any further issues. The exception only occurs during the first call to k4a_playback_get_next_capture.

To Reproduce

  1. In Visual Studio, create a new terminal project
  2. In Visual Studio, enable manifest mode in the project (Project>Properties>vcpkg>Use vcpkg Manifest: "yes"
  3. In Visual Studio, View>terminal and type:
    • vcpkg new --application
    • vcpkg add port azure-kinect-sensor-sdk
  4. Replace the current main.cpp content by:
#include <k4a/k4a.h>
#include <k4arecord/playback.h>
int main(int argc, char** argv){
    k4a_playback_t playback_handle = NULL;
    if (k4a_playback_open("abs/path/to/video.mkv", &playback_handle) != K4A_RESULT_SUCCEEDED){
        return 1;
    }
    k4a_capture_t capture = NULL;
    k4a_playback_get_next_capture(playback_handle, &capture);
    k4a_playback_close(playback_handle);
    return 0;
}
  1. Set system environment variables to:
    • K4A_ENABLE_LOG_TO_A_FILE = 0
    • K4A_RECORD_ENABLE_LOG_TO_A_FILE = 0
    • K4A_LOG_LEVEL = w
      or
    • K4A_ENABLE_LOG_TO_A_FILE = logs/k4a.log
    • K4A_RECORD_ENABLE_LOG_TO_A_FILE = = logs/k4arecord.log
    • K4A_LOG_LEVEL = w
  2. In Visual Studio, Build the solution
  3. In Visual Studio, Start debugging

Expected behavior
I expected the log files to be ignored (with environment variables to 0) or to be filled as intended without triggering an error.

Desktop

  • OS with Version: Windows 11 Home, Version 23H2, OS build 22631.4037
  • SDK Version: azure-kinect-sensor-sdk:[email protected]
  • Microsoft Visual Studio Community 2022, Version 17.11.0 (downloaded and installed the 12/08/2024)

Additional context
See the screenshot below.
Also, I have read/used:
https://learn.microsoft.com/en-us/azure/kinect-dk/record-playback-api
https://learn.microsoft.com/en-us/azure/Kinect-dk/troubleshooting#collecting-logs
#1015

Thank you!
Best,
Basil

overall

@bas1l bas1l added Bug Something isn't working Code Sample This issue is related to a code sample Triage Needed The Issue still needs to be reviewed by Azure Kinect team members. labels Aug 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Something isn't working Code Sample This issue is related to a code sample Triage Needed The Issue still needs to be reviewed by Azure Kinect team members.
Projects
None yet
Development

No branches or pull requests

1 participant