00001 #ifndef __application_config_h__ 00002 #define __application_config_h__ 00003 00004 #include "current_config.hrh" 00005 #include "common/platform_config.h" 00006 00007 // NDEBUG controls whether asserts are to be compiled in (NDEBUG is 00008 // defined automatically for Symbian UDEB builds). Normally an assert 00009 // results in something being printed to the console. Whether the 00010 // assertion errors are also logged is controlled by __DO_LOGGING__. 00011 #if !defined(__SYMBIAN32__) && !__FEATURE_DEBUGGING__ 00012 #define NDEBUG 1 00013 #endif 00014 00015 #if __FEATURE_UPLOADER__ && !__UPLOAD_WITH_CURL__ 00016 #if !defined(__UPLOAD_TIME_EXPR__) 00017 #error some default upload time expression should be defined 00018 #endif 00019 #if !defined(__USERNAME__) 00020 #error some default username should be defined 00021 #endif 00022 #if !defined(__UPLOAD_URL__) 00023 #error some default upload url should be defined 00024 #endif 00025 #endif /* __FEATURE_UPLOADER__ */ 00026 00027 #if !defined(__SYMBIAN32__) 00028 #define EVENT_CALLBACK_WITH_GERROR 1 00029 #endif /* __SYMBIAN32__ */ 00030 00031 #define NO_THREAD_SAFETY defined(__EPOC32__) 00032 #define THREAD_SAFETY (!(NO_THREAD_SAFETY)) 00033 00034 // Adapted from _LIT macro. For this one "s" must be a wide (i.e., L"") string. 00035 #define _LIT_W(name,s) const static TLitC<sizeof(s)/2> name={sizeof(s)/2-1,s} 00036 00037 #define COMPONENT_NAME "cl2app" 00038 #define COMPONENT_NAME_W L"cl2app" 00039 00040 #define COMPONENT_NAME_LIT8(ident) _LIT8(ident, COMPONENT_NAME) 00041 #define COMPONENT_NAME_LIT(ident) _LIT_W(ident, COMPONENT_NAME_W) 00042 00043 #define PRIMARY_LOG_FILENAME "cl2app_log.txt" 00044 00045 // Invoked internally by logging.cpp. 00046 #define DEFINE_LOG_FILE_DIR _LIT(KLogFileDir, "cl2"); 00047 00048 // Invoked internally by logging.cpp. 00049 #define DEFINE_ASSERT_LOG_FILENAME _LIT(KAssertLogFile, "cl2app_assert.txt"); 00050 00051 // Invoked internally by panic.cpp. 00052 #define DEFINE_PANIC_CATEGORY COMPONENT_NAME_LIT(KPanicCategory) 00053 00054 #ifdef __SYMBIAN32__ 00055 // Note that anything under C: is automatically included in system 00056 // backups, so do not change this elsewhere without good reason. (We 00057 // might want to use RFs::GetSystemDrive() to get the drive letter 00058 // instead of assuming "C:".) 00059 #define CONFIG_DIR "c:\\data\\cl2" 00060 #define DATABASE_DIR_DEFAULT "e:\\data\\cl2" 00061 #else 00062 #define CONFIG_DIR "." 00063 #define DATABASE_DIR_DEFAULT "." 00064 #endif 00065 00066 #define DATABASE_DISK_THRESHOLD_DEFAULT 10000000 00067 00068 /** Log database file. 00069 */ 00070 #define LOGDB_BASENAME "log.db" 00071 00072 /** These options should generally not be enabled, 00073 but may be useful for testing and debugging. 00074 */ 00075 //#define ALWAYS_RECREATE_DB !defined(NDEBUG) 00076 #define ALWAYS_RECREATE_DB 0 00077 00078 #ifdef __cplusplus 00079 extern "C" { 00080 #endif 00081 00082 // If running a daemon, then most likely you wish to stop the entire 00083 // process if there is a fatal error, and leave it for the watchdog to 00084 // decide when to try to restart. If running within a host 00085 // application, then you might just want to stop the logger component 00086 // (or take some application-specific action), and leave the actual 00087 // application running; in this case it is the responsibility of the 00088 // application to attempt restarting as desired. In any case, you 00089 // should define EXIT_APPLICATION to map to the desired behavior. Note 00090 // that you should not assume that EXIT_APPLICATION will not return, 00091 // rather consider it as making a request to get CL2 stopped soon. 00092 // 00093 // See epoc-main.cpp and cl2appappui.cpp for the Symbian 00094 // implementations. 00095 // 00096 // You may optionally also define a "nicer" variant of 00097 // EXIT_APPLICATION by defining SHUTDOWN_APPLICATION. The nicer 00098 // variant may be used in cases where immediate exit is undesirable. 00099 #if defined(__SYMBIAN32__) || __IS_APPLICATION__ 00100 void ExitApplication(); 00101 #define EXIT_APPLICATION ExitApplication() 00102 void ShutdownApplication(); 00103 #define SHUTDOWN_APPLICATION ShutdownApplication() 00104 #else // not Symbian 00105 #include <stdlib.h> 00106 #define EXIT_APPLICATION abort() 00107 #endif 00108 00109 #ifndef SHUTDOWN_APPLICATION 00110 #define SHUTDOWN_APPLICATION EXIT_APPLICATION 00111 #endif 00112 00113 #ifdef __cplusplus 00114 } /* extern "C" */ 00115 #endif 00116 00117 #endif /* __application_config_h__ */ 00118 00119 /** 00120 00121 application_config.h 00122 00123 Copyright 2009 Helsinki Institute for Information Technology (HIIT) 00124 and the authors. All rights reserved. 00125 00126 Authors: Tero Hasu <tero.hasu@hut.fi> 00127 00128 Permission is hereby granted, free of charge, to any person 00129 obtaining a copy of this software and associated documentation files 00130 (the "Software"), to deal in the Software without restriction, 00131 including without limitation the rights to use, copy, modify, merge, 00132 publish, distribute, sublicense, and/or sell copies of the Software, 00133 and to permit persons to whom the Software is furnished to do so, 00134 subject to the following conditions: 00135 00136 The above copyright notice and this permission notice shall be 00137 included in all copies or substantial portions of the Software. 00138 00139 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00140 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00141 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 00142 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 00143 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 00144 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 00145 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 00146 SOFTWARE. 00147 00148 **/
ContextLogger2—ContextLogger2 Logger Daemon Internals—Generated on Mon May 2 13:49:51 2011 by Doxygen 1.6.1