diff --git a/win/ahk/WindowManager.ahk b/win/ahk/WindowManager.ahk index 39e20a7..1ba79f5 100644 --- a/win/ahk/WindowManager.ahk +++ b/win/ahk/WindowManager.ahk @@ -113,14 +113,14 @@ MoveActiveWinByDirection(direction) { wy := wy + PADDING wh := wh - PADDING * 2 WinMove, A,, wx - l, wy - t, ww + l + r, wh + t + b - LogDebug(Format("move {1} to {2}", activeWinId, direction)) + LogDebug("move {1} to {2}", activeWinId, direction) SaveActiveWindowDirection(direction) } SaveArrangement() { - LogDebug("SaveArrangement start") global ARRANGEMENT global ARRANGEMENT_PATH + LogDebug("SaveArrangement to {1} start", ARRANGEMENT_PATH) file := FileOpen(ARRANGEMENT_PATH, "w") file.Write(JSON.Dump(ARRANGEMENT,, 2)) file.Close() @@ -130,7 +130,7 @@ SaveArrangement() { LoadArrangement() { global ARRANGEMENT global ARRANGEMENT_PATH - LogDebug("LoadArrangement start " .ARRANGEMENT_PATH) + LogDebug("LoadArrangement start {1}", ARRANGEMENT_PATH) try { FileRead, temp, %ARRANGEMENT_PATH% ARRANGEMENT := JSON.Load(temp) @@ -232,11 +232,12 @@ ActiveWinInfo() { } AdjustNewWindow() { + global ARRANGEMENT seen := IsActiveWindowSeen() arrangable := IsActiveWindowArrangable() wininfo := ActiveWinInfo() if not seen { - LogDebug(Format("win: {1}, seen: {2}, arrangable: {3}", wininfo, seen, arrangable)) + LogDebug("win: {1}, seen: {2}, arrangable: {3}", wininfo, seen, arrangable) } if not seen and arrangable { windowPath := GetActiveWindowPath() diff --git a/win/win.ahk b/win/win.ahk index a74a82d..e226ddc 100644 --- a/win/win.ahk +++ b/win/win.ahk @@ -14,14 +14,14 @@ ToggleDebugging() { DEBUGGING := not DEBUGGING } -LogDebug(msg) { +LogDebug(params*) { global DEBUGGING if (not DEBUGGING) { return } FormatTIme, now, , MM-dd HH:mm:ss log := FileOpen("d:\win.ahk.log", "a") - log.WriteLine(Format("[{1}] {2}", now, msg)) + log.WriteLine(Format("[{1}] {2}", now, Format(params*))) log.Close() }