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 file created, but is empty. #67

Closed
ChinmayTyagi opened this issue Aug 19, 2021 · 6 comments
Closed

Log file created, but is empty. #67

ChinmayTyagi opened this issue Aug 19, 2021 · 6 comments

Comments

@ChinmayTyagi
Copy link

ChinmayTyagi commented Aug 19, 2021

Hello,
This looks like a great tool to switch between my work computer and PC, while saving some money. However, I'm having some trouble with setup.

I am on windows on both systems, with 2 monitors and a USB switch as my "USB device".
Given a 2-monitor setup and USB hub as my device, I have created the following config file (all the way at bottom).
When I run the display_switch.ex (copied to AppData/roaming), a log file is created. However, this file is empty. Since I have no feedback, it's hard to know exactly where I am messing up.

Any advice? Thanks so much!

display-switch.ini:

usb_device = "1A40:0101"

[monitor1]
monitor_id = "GSM7706"
on_usb_connect = "Hdmi1"

[monitor2]
monitor_id = "LEN61E6"
on_usb_connect = "DisplayPort1"

@youngmit
Copy link

I am in nearly the exact situation. Two monitors, Windows. When running the exe, it quits immediately, no standard out, no contents in the log file.

@zeezez
Copy link

zeezez commented Oct 11, 2021

Hi, I am encountering the same issues as you both (two screens, windows).

I had thought I didn't build the executable properly -- but after reinstalling Rust and rebuilding from source several times I'm not sure what's going on.

Running the exe does indeed create the display-switch directory and display-watch.log in %APPDATA% but as noted it is empty. Nothing comes up otherwise.

I was really looking forward to using this utility so I wonder if someone could help us resolve this. Thanks!

@haimgel
Copy link
Owner

haimgel commented Oct 14, 2021

When you run the app from the command line, does it print anything prior to terminating? I suspect it's crashing on startup, and it should print the stack trace when it does that. Please share whatever it says...

@haimgel
Copy link
Owner

haimgel commented Oct 18, 2021

Actually, on Windows the app wasn't printing anything on the console ever. This is being fixed in the upcoming release, so the suggestion above would be valid when 1.1 is released.

@jordevorstenbosch
Copy link

jordevorstenbosch commented Dec 20, 2021

Actually, on Windows the app wasn't printing anything on the console ever. This is being fixed in the upcoming release, so the suggestion above would be valid when 1.1 is released.

It still doesn't put anything in the logfile on windows it seems.

Trough console I get the following though:

PS C:\Users\micro\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup> .\display_switch.exe
PS C:\Users\micro\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup> Error: failed to load configuration

Caused by:
    ParseIntError { kind: InvalidDigit }

My ini file in %appdata%/display-switch/display-switch.ini:

usb_device = "A8F8:1830"

[monitor1]
monitor_id = "LG"
on_usb_connect = "Hdmi"
on_usb_disconnect = "DisplayPort1"

[monitor2]
monitor_id = "Samsung"
on_usb_connect = "DisplayPort1"
on_usb_disconnect = "Hdmi1"

It works fine when I correct the .ini file. The log is however empty.

Edit:

For clarification, it does output to the log file when it actually succeeds in running.

@haimgel
Copy link
Owner

haimgel commented Jan 10, 2022

I think the "invalid digit" message is misleading, but the root cause is that on_usb_connect = "Hdmi" line is invalid. It needs to be Hdmi1 or Hdmi2 etc. The first thing the app does is parsing the config file, if that failed, it does not go further, this is the reason the log file is empty IMO.

@haimgel haimgel closed this as completed Aug 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants