Skip to content

Commit

Permalink
Fix #3170.
Browse files Browse the repository at this point in the history
  • Loading branch information
dkocher committed May 5, 2009
1 parent a2b40e2 commit 406d5e9
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 64 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Expand Up @@ -1283,7 +1283,6 @@ lib/jets3t-0.7.1.jar -text
lib/libAquaticPrime.a -text
lib/log4j-1.2.15.jar -text
lib/log4j.xml -text
lib/log4j.xml.debug -text
lib/mime.types -text
lv.lproj/Alert.nib/classes.nib -text
lv.lproj/Alert.nib/info.nib -text
Expand Down
19 changes: 3 additions & 16 deletions lib/log4j.xml
Expand Up @@ -6,26 +6,13 @@
<param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n"/>
</layout>
</appender>
<logger name="ch.cyberduck">
<level value="debug"/>
</logger>
<logger name="org.apache.commons.httpclient">
<level value="info"/>
</logger>
<logger name="httpclient.wire.content">
<level value="debug"/>
<logger name="httpclient.wire.content" additivity="false">
<level value="error"/>
</logger>
<logger name="httpclient.wire.header">
<logger name="httpclient.wire.header" additivity="false">
<level value="debug"/>
</logger>
<logger name="org.jets3t">
<level value="info"/>
</logger>
<logger name="org.jets3t.service.utils">
<level value="warn"/>
</logger>
<root>
<priority value="debug"/>
<appender-ref ref="console"/>
</root>
</log4j:configuration>
31 changes: 0 additions & 31 deletions lib/log4j.xml.debug

This file was deleted.

27 changes: 11 additions & 16 deletions source/ch/cyberduck/core/Preferences.java
Expand Up @@ -18,9 +18,9 @@
* dkocher@cyberduck.ch
*/

import com.apple.cocoa.foundation.NSArray;
import com.apple.cocoa.foundation.NSBundle;
import com.apple.cocoa.foundation.NSPathUtilities;
import com.apple.cocoa.foundation.NSArray;

import ch.cyberduck.ui.cocoa.CDBrowserTableDataSource;
import ch.cyberduck.ui.cocoa.CDPortablePreferencesImpl;
Expand All @@ -30,10 +30,10 @@
import org.apache.log4j.Logger;

import java.io.File;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.TimeZone;
import java.util.Date;

/**
* Holding all application preferences. Default values get overwritten when loading
Expand Down Expand Up @@ -64,7 +64,7 @@ public abstract class Preferences {
*/
public static Preferences instance() {
synchronized(lock) {
if (null == current) {
if(null == current) {
if(null == NSBundle.mainBundle().objectForInfoDictionaryKey("application.preferences.path")) {
current = new CDPreferencesImpl();
}
Expand Down Expand Up @@ -138,26 +138,21 @@ protected void setDefaults() {
else {
APP_SUPPORT_DIR = new File(
NSPathUtilities.stringByExpandingTildeInPath(
(String)NSBundle.mainBundle().objectForInfoDictionaryKey("application.support.path")));
(String) NSBundle.mainBundle().objectForInfoDictionaryKey("application.support.path")));
}
APP_SUPPORT_DIR.mkdirs();

defaults.put("application.support.path", APP_SUPPORT_DIR.getAbsolutePath());

/**
* The logging level (DEBUG, INFO, WARN, ERROR)
*/
defaults.put("logging", "ERROR");

final Level level = Level.toLevel(this.getProperty("logging"));
Logger.getLogger("ch.cyberduck").setLevel(level);

// Always logged to at DEBUG level
Logger.getLogger("httpclient.wire.content").setLevel(Level.ERROR);
// Always logged to at DEBUG level
Logger.getLogger("httpclient.wire.header").setLevel(Level.DEBUG);
final Logger root = Logger.getRootLogger();
root.setLevel(Level.toLevel(this.getProperty("logging")));

defaults.put("version",
defaults.put("version",
NSBundle.mainBundle().objectForInfoDictionaryKey("CFBundleShortVersionString").toString());
/**
* How many times the application was launched
Expand Down Expand Up @@ -266,7 +261,7 @@ protected void setDefaults() {
defaults.put("alert.toggle.transcript", String.valueOf(0));

defaults.put("transfer.toggle.details", String.valueOf(1));

/**
* Default editor
*/
Expand Down Expand Up @@ -540,7 +535,7 @@ protected void setDefaults() {
defaults.put("archive.command.expand.bz2", "bzip2 -dvk {0}");

defaults.put("update.check", String.valueOf(true));
final int DAY = 60*60*24;
final int DAY = 60 * 60 * 24;
defaults.put("update.check.interval", String.valueOf(DAY)); // periodic update check in seconds
}

Expand All @@ -553,7 +548,7 @@ protected void setDefaults() {
*/
public Object getObject(String property) {
Object value = defaults.get(property);
if (null == value) {
if(null == value) {
log.warn("No property with key '" + property + "'");
}
return value;
Expand Down

0 comments on commit 406d5e9

Please sign in to comment.