Reduce logging in UpcomingWidget
[acal.git] / src / com / morphoss / acal / Constants.java
blobf99a238303031201449516348eeffac522702aeb
1 /*
2 * Copyright (C) 2011 Morphoss Ltd
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation, either version 3 of the
7 * License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 package com.morphoss.acal;
21 import java.util.regex.Pattern;
23 import com.morphoss.acal.xml.DavParserFactory;
24 import com.morphoss.acal.xml.DavParserFactory.PARSEMETHOD;
26 import android.os.Environment;
27 import android.util.Log;
29 /**
30 * Constants class for keeping Global constant values.
32 * @author Morphoss Ltd
35 public class Constants {
37 public static final String PUBLIC_DATA_DIR = Environment.getExternalStorageDirectory()+"/acal/";
38 public static final String COPY_DB_TARGET = PUBLIC_DATA_DIR+"acal.db"; //File path and name of copy
39 public static final long MAXIMUM_SERVICE_WORKER_DELAY_MS = 1000*60*60*24; //maximum time between worker thread runs in ms
40 public static final long SERVICE_WORKER_GRACE_PERIOD = 1000*60*60*1; //Amount of time we will allow worker to be 'late' before assuming its hung
42 /** Generally useful patterns */
43 public static final Pattern lineSplitter = Pattern.compile("\\r?\\n");
44 public static final Pattern rfc5545UnWrapper = Pattern.compile("\r?\n ",Pattern.DOTALL);
45 public final static Pattern splitOnCommas = Pattern.compile(",");
46 public static final Pattern matchSegmentName = Pattern.compile("([^/]+)$");
48 /** Set this to false and all debug logging is turned off */
49 public static final boolean DEBUG_MODE = false;
51 /** How much stuff to spit out into the logs */
52 public static final boolean LOG_VERBOSE = true && DEBUG_MODE; //Very verbose play by play execution information
53 public static final boolean LOG_DEBUG = true && DEBUG_MODE; //Information relevant to debugging tasks.
54 public static final boolean DEBUG_SETTINGS = true && DEBUG_MODE; // Does the debugging menu appear in Settings
56 /** Since Andrew's device won't display logs at DEBUG level he needs a way to fake that! */
57 /* public static final int LOGV = Log.INFO; // Normally should be Log.VERBOSE of course.
58 public static final int LOGD = Log.INFO; // Normally should be Log.DEBUG of course.
59 public static final int LOGI = Log.WARN; // Normally should be Log.INFO of course.
60 public static final int LOGW = Log.ERROR; // Normally should be Log.WARN of course.
61 public static final int LOGE = Log.ASSERT; // Normally should be Log.ERROR of course.
63 public static final int LOGV = Log.VERBOSE;
64 public static final int LOGD = Log.DEBUG;
65 public static final int LOGI = Log.INFO;
66 public static final int LOGW = Log.WARN;
67 public static final int LOGE = Log.ERROR;
69 /** And sometimes we want to really deeply debug specific bits */
70 public static final boolean debugRepeatRule = false && DEBUG_MODE;
71 public static final boolean debugCalendar = false && DEBUG_MODE;
72 public static final boolean debugSyncChangesToServer = false && DEBUG_MODE;
73 public static final boolean debugSyncCollectionContents = false && DEBUG_MODE;
74 public static final boolean debugCalendarDataService = false && DEBUG_MODE;
75 public static final boolean debugMonthView = false && DEBUG_MODE;
76 public static final boolean debugWeekView = false && DEBUG_MODE;
77 public static final boolean debugVComponent = false && DEBUG_MODE;
78 public static final boolean debugDateTime = false && DEBUG_MODE;
79 public static final boolean debugDavCommunication = false && DEBUG_MODE;
80 public static final boolean debugAlarms = false && DEBUG_MODE;
81 public static final boolean debugHeap = false && DEBUG_MODE;
82 public static final boolean debugCheckServerDialog = false && DEBUG_MODE;
83 public static final boolean debugTheming = false && DEBUG_MODE;
84 public static final boolean debugWidget = false && DEBUG_MODE;
86 public static final long DEFAULT_MAX_AGE_WIFI = 1000*60*30; // The default to use when initialising a new collection
87 public static final long DEFAULT_MAX_AGE_3G = 1000*60*60*2; // The default to use when initialising a new collection
89 public static final String NS_DAV = "DAV:";
90 public static final String NS_CALDAV = "urn:ietf:params:xml:ns:caldav";
91 public static final String NS_CARDDAV = "urn:ietf:params:xml:ns:carddav";
92 public static final String NS_ACAL = "urn:com:morphoss:acal";
93 public static final String NS_CALENDARSERVER = "http://calendarserver.org/ns/";
94 public static final String NS_ACALCONFIG = "urn:com:morphoss:acalconfig";
95 public static final String NS_ICAL = "http://apple.com/ns/ical/";
97 public static final String CRLF = "\r\n";
99 public static final String URLEncoding = "utf-8";
101 public static final String lastRevisionPreference = "prefLastRevision";
102 public static final PARSEMETHOD XMLParseMethod = DavParserFactory.PARSEMETHOD.SAX;