]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
remove file logging from automatically being set on the core console handle. You...
authorMichael Jerris <mike@jerris.com>
Tue, 4 Dec 2007 23:18:24 +0000 (23:18 +0000)
committerMichael Jerris <mike@jerris.com>
Tue, 4 Dec 2007 23:18:24 +0000 (23:18 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6509 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_core.h
src/switch.c
src/switch_core.c

index 66ed31444843b29e084bbabb2d550e9ec645a0cc..a97d2637ba41582ed41ae373b4cd3938519698b9 100644 (file)
@@ -242,7 +242,7 @@ SWITCH_DECLARE(void) switch_core_port_allocator_destroy(switch_core_port_allocat
   \param err a pointer to set any errors to
   \note to be called at application startup
 */
-SWITCH_DECLARE(switch_status_t) switch_core_init(const char *console, switch_core_flag_t flags, const char **err);
+SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, const char **err);
 
 /*! 
   \brief Initilize the core and load modules
@@ -251,7 +251,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(const char *console, switch_cor
   \param err a pointer to set any errors to
   \note to be called at application startup instead of switch_core_init.  Includes module loading.
 */
-SWITCH_DECLARE(switch_status_t) switch_core_init_and_modload(const char *console, switch_core_flag_t flags, const char **err);
+SWITCH_DECLARE(switch_status_t) switch_core_init_and_modload(switch_core_flag_t flags, const char **err);
 
 /*! 
   \brief Set/Get Session Limit
index 21db4b95e012b1ed71e592d01a8a543003c30508..9a7658d69dc4ba0d39237ee3090a2563250fbc37 100644 (file)
 #define PIDFILE "freeswitch.pid"
 static char *pfile = PIDFILE;
 
-/* log filename: Filename of the freeswitch log file to be used if we are in background mode */
-#define LOGFILE "freeswitch.log"
-static char *lfile = LOGFILE;
-
 /* If we are a windows service, what should we be called */
 #define SERVICENAME "Freeswitch"
 
@@ -184,7 +180,7 @@ void WINAPI service_main(DWORD numArgs, char **args)
        set_high_priority();
 
        /* attempt to initialize freeswitch and load modules */
-       if (switch_core_init_and_modload(lfile, flags, &err) != SWITCH_STATUS_SUCCESS) {
+       if (switch_core_init_and_modload(flags, &err) != SWITCH_STATUS_SUCCESS) {
                /* freeswitch did not start sucessfully */
                status.dwCurrentState = SERVICE_STOPPED;
        } else {
@@ -422,7 +418,7 @@ int main(int argc, char *argv[])
        }
 #endif
 
-       if (switch_core_init_and_modload(nc ? lfile : NULL, flags, &err) != SWITCH_STATUS_SUCCESS) {
+       if (switch_core_init_and_modload(flags, &err) != SWITCH_STATUS_SUCCESS) {
                fprintf(stderr, "Cannot Initilize [%s]\n", err);
                return 255;
        }
index 4f1d73f00223f6bd34be0c92dd73bd9104f884d7..c7c3cfb519635f5ab6cf5bf381128936fb94a5fb 100644 (file)
@@ -641,7 +641,7 @@ static void load_mime_types(void)
 
 }      
 
-SWITCH_DECLARE(switch_status_t) switch_core_init(const char *console, switch_core_flag_t flags, const char **err)
+SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, const char **err)
 {
        switch_xml_t xml = NULL, cfg = NULL;
        switch_uuid_t uuid;
@@ -743,20 +743,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(const char *console, switch_cor
 
        *err = NULL;
 
-       if (console) {
-               if (*console != '/') {
-                       char path[265];
-                       snprintf(path, sizeof(path), "%s%s%s", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR, console);
-                       console = path;
-               }
-               if (switch_core_set_console(console) != SWITCH_STATUS_SUCCESS) {
-                       *err = "FATAL ERROR! Could not open console\n";
-                       apr_terminate();
-                       return SWITCH_STATUS_GENERR;
-               }
-       } else {
-               runtime.console = stdout;
-       }
+       runtime.console = stdout;
 
        assert(runtime.memory_pool != NULL);
        switch_log_init(runtime.memory_pool);
@@ -821,10 +808,10 @@ static void handle_SIGINT(int sig)
        if (sig);
        return;
 }
-SWITCH_DECLARE(switch_status_t) switch_core_init_and_modload(const char *console, switch_core_flag_t flags, const char **err)
+SWITCH_DECLARE(switch_status_t) switch_core_init_and_modload(switch_core_flag_t flags, const char **err)
 {
        switch_event_t *event;
-       if (switch_core_init(console, flags, err) != SWITCH_STATUS_SUCCESS) {
+       if (switch_core_init(flags, err) != SWITCH_STATUS_SUCCESS) {
                return SWITCH_STATUS_GENERR;
        }