Skip to content

Commit

Permalink
windows: improve logging
Browse files Browse the repository at this point in the history
Decrease log level, add more detailed log description
  • Loading branch information
Mikhail Lukashov authored and jevank committed Jan 21, 2022
1 parent 214fbfd commit 6877173
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions windows/src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,14 @@ libvchan_t *libvchan_client_init(int domain, int port) {

status = WaitForSingleObject(path_watch_event, 100);
if (status != WAIT_OBJECT_0) {
Log(XLL_ERROR, "Wait for xenstore (1) failed: 0x%x", GetLastError());
Log(XLL_WARNING, "Wait for xenstore (1) failed: 0x%x", GetLastError());
// don't fail completely yet, if we can read the store values we're ok
}

// wait two times because Xen always signals the watch immediately after creation
status = WaitForSingleObject(path_watch_event, 100);
if (status != WAIT_OBJECT_0) {
Log(XLL_ERROR, "Wait for xenstore (2) failed: 0x%x", GetLastError());
Log(XLL_WARNING, "Wait for xenstore (2) failed: 0x%x", GetLastError());
}

XcStoreRemoveWatch(xc_handle, path_watch_handle);
Expand Down
4 changes: 2 additions & 2 deletions windows/src/libvchan_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ int libvchan__check_domain_alive(PXENCONTROL_CONTEXT xc_handle, int dom);
void _Log(XENCONTROL_LOG_LEVEL logLevel, LPCSTR function, PWCHAR format, ...);

#ifdef __MINGW32__
#define Log(level, msg, ...) _Log(level, __FUNCTION__, L"(%p)" L##msg L"\n", ctrl, ##__VA_ARGS__)
#define Log(level, msg, ...) _Log(level, __FUNCTION__, L"(%p) " L##msg L"\n", ctrl, ##__VA_ARGS__)
#else
#define Log(level, msg, ...) _Log(level, __FUNCTION__, L"(%p)" L##msg L"\n", ctrl, __VA_ARGS__)
#define Log(level, msg, ...) _Log(level, __FUNCTION__, L"(%p) " L##msg L"\n", ctrl, __VA_ARGS__)
#endif

#endif

0 comments on commit 6877173

Please sign in to comment.