Added some basic logging

This commit is contained in:
Joshua Fuhs 2012-06-17 10:35:57 -04:00
parent 65090c573c
commit a82d486a35
2 changed files with 28 additions and 0 deletions

25
src/Log.ahk Executable file
View file

@ -0,0 +1,25 @@
/**
* bug.n - tiling window management
* Copyright (c) 2010-2012 joten
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @version 8.3.0
*/
Log_msg( message ) {
FormatTime, CurrentTime, , yyyyMMddHHmmss
FileAppend, %CurrentTime% %message%`r`n, bugn_log.txt
}

View file

@ -32,6 +32,7 @@ SetWinDelay, 10
#WinActivateForce
; pseudo main function
Log_msg("====== Initializing ======")
If 0 = 1
Config_filePath = %1%
Config_init()
@ -52,6 +53,7 @@ Return ; end of the auto-execute section
* function & label definitions
*/
Main_cleanup: ; The labels with "ExitApp" or "Return" at the end and hotkeys have to be after the auto-execute section.
Log_msg("====== Cleaning up ======")
If Config_autoSaveSession
Config_saveSession()
Manager_cleanup()
@ -129,6 +131,7 @@ Main_toggleBar:
Monitor_toggleBar()
Return
#Include Log.ahk
#Include Bar.ahk
#Include Config.ahk
#Include Manager.ahk