Beginning update to add GUI logging.

This commit is contained in:
Jonathan Bernard
2010-04-02 05:43:04 -05:00
parent 5b3e2066a2
commit dbb2121525
11 changed files with 547 additions and 39 deletions

View File

@ -0,0 +1,16 @@
package com.jdbernard.timestamper
class LogDialogController {
// these will be injected by Griffon
def model
def view
void mvcGroupInit(Map args) {
// this method is called after model and view are injected
}
/*
def action = { evt = null ->
}
*/
}

View File

@ -14,7 +14,7 @@ class TimeStamperMainController {
def configFile
logger.traceIfEnabled("Initializing TimeStamperMain MVC...")
logger.traceIfEnabled {"Initializing TimeStamperMain MVC..."}
def thisMVC = ['model': model, 'view': view, 'controller': this]
@ -30,8 +30,8 @@ class TimeStamperMainController {
configFile = new File(userHomeDir, ".timestamperrc")
if (!configFile.exists()) configFile.createNewFile()
logger.traceIfEnabled("Reading configuration from "
+ "'${configFile.name}'")
logger.traceIfEnabled { "Reading configuration from "
+ "'${configFile.name}'"}
try { configFile.withInputStream { prop.load(it) } }
catch (IOException ioe) {
@ -47,7 +47,7 @@ class TimeStamperMainController {
model.config.setProperty('lastUsed', lastUsed)
}
logger.traceIfEnabled("Reading Timeline properties from '${lastUsed}'")
logger.traceIfEnabled {"Reading Timeline properties from '${lastUsed}'"}
model.timelinePropertiesFile = new File(lastUsed)
if (!model.timelinePropertiesFile.exists())
@ -77,7 +77,7 @@ class TimeStamperMainController {
def exitGracefully = { evt = null ->
logger.traceIfEnabled("Exiting gracefully.")
logger.traceIfEnabled {"Exiting gracefully."}
// save config
logger.debugIfEnabled("Config: ${model.config}")
@ -91,7 +91,7 @@ class TimeStamperMainController {
// save timeline and properties
model.timelineProperties.save()
logger.traceIfEnabled("Completed graceful shutdown.")
logger.traceIfEnabled {"Completed graceful shutdown."}
app.shutdown()
}