|
From: bob f. <chi...@ma...> - 2003-07-12 15:34:30
|
my 2 cents. configuration should easy, but flexible. I always assumed we'd be using NSUserDefaults and/or accepting arguments from the command line. My thoughts: 1) From the command line you should be able to specify a config file that will be used instead of NSUserDefaults, also, you should be able to specify either on the command line or in the config file that it should be saved as the new NSUserDefaults config. 2) if we don't store the config info in NSUserDefaults, at a minimum we should store the location of the config file, and I would suggest looking for the config file to be specified in: a) command line b) NSUserDefaults c) NSGlobalDomain (maybe there is a generic config for this server/machine); d) if these fail, then perhaps, also look in well defined locations, for example 1) in the app wrapper 2) ~/Library/Application Support/AppName/Log4Cocoa.xml 3) /Library/Application Support/AppName/Log4Cocoa.xml 4) use default mode (i.e. set root loger to either info or debug? & log somewhere reasonable: probably console or a maybe a file)? - these are just examples, maybe this is too many places to search and will confuse people, but I'd like to make it easy to deploy on a server and also have individual users debug with their own logging configs. 3) Extra Credit: if we want to get tricky, we could have multiple configs saved in NSUserDefaults, and from the command line or NSUserDefaults. For example: the entire config could be useLoggingProfile = default | production | development | staging, etc . . . . . Just some random musings. 4) maybe it would also make sense to save the filename, path, & timestamp of the file that we got the config from so we can easily reload if we want (maybe it'd be automatic or a config option ... "reload config"). -Bob PS: this is really musing for the final design . . . . *definitely* not the first pass, the first approach would be to get something working :-). BTW: w/r/t/ file formats, I vote we only accept XML or Apple .plist file formats, later if someone is feeling adventurous they could make a converter for the java properties format (I'm not inclined to do so). On Thursday, July 10, 2003, at 01:58 AM, Chris Hanson wrote: > On Wednesday, July 9, 2003, at 12:18 PM, Michael Tsai wrote: >> Personally, I think it should match Cocoa as much as possible. > > As do I. > > I think NSUserDefaults is the way to go for Log4Cocoa; it gets us so > much for free, I think we'd be crazy not to use it. It even lets us > do things like override settings just by running an application at the > command line. > > The question is, should there just be one Log4Cocoa key in an > application's defaults that all the potential Log4Cocoa settings would > live under? > > -- Chris > > -- > Chris Hanson, bDistributed.com, Inc. | Email: cm...@bD... > Custom Application Development | Phone: +1-847-372-3955 > http://bdistributed.com/ | Fax: +1-847-589-3738 > http://bdistributed.com/Articles/ | Personal Email: cm...@ma... |