コード例 #1
0
void warning(int err, const char *fmt, ...) 
{
    int e;
    
    if ((e = thread_to[thread_slot()])) {
        FUNCTION_GUTS_EXCL(GW_WARNING, "");
    } else {
        FUNCTION_GUTS(GW_WARNING, "");
    }
}
コード例 #2
0
void info(int err, const char *fmt, ...) 
{
    int e;
    
    if ((e = thread_to[thread_slot()])) {
        FUNCTION_GUTS_EXCL(GW_INFO, "");
    } else {
        FUNCTION_GUTS(GW_INFO, "");
    }
}
コード例 #3
0
void error(int err, const char *fmt, ...) 
{
    int e;
    
    if ((e = thread_to[thread_slot()])) {
        FUNCTION_GUTS_EXCL(GW_ERROR, "");
    } else {
        FUNCTION_GUTS(GW_ERROR, "");
    }
}
コード例 #4
0
void gw_panic(int err, const char *fmt, ...)
{
    /*
     * we don't want PANICs to spread accross smsc logs, so
     * this will be always within the main core log.
     */
    FUNCTION_GUTS(GW_PANIC, "");

    gw_backtrace(NULL, 0, 0);

#ifdef SEGFAULT_PANIC
    *((char*)0) = 0;
#endif

    exit(EXIT_FAILURE);
}
コード例 #5
0
ファイル: log.cpp プロジェクト: daoopp/mse
void debug(const char *place, int e, const char *fmt, ...) 
{
	// If we don't need output debug information.
	if (log_g_i_need_debug == 0)
		return;

    if (place_should_be_logged(place) && place_is_not_logged(place) == 0) {
	FUNCTION_GUTS(OS_DEBUG, "");
	/*
	 * Note: giving `place' to FUNCTION_GUTS makes log lines
    	 * too long and hard to follow. We'll rely on an external
    	 * list of what places are used instead of reading them
    	 * from the log file.
	 */
    }
}
コード例 #6
0
void debug(const char *place, int err, const char *fmt, ...) 
{
    int e;
    
    if (place_should_be_logged(place) && place_is_not_logged(place) == 0) {
	/*
	 * Note: giving `place' to FUNCTION_GUTS makes log lines
    	 * too long and hard to follow. We'll rely on an external
    	 * list of what places are used instead of reading them
    	 * from the log file.
	 */
        if ((e = thread_to[thread_slot()])) {
            FUNCTION_GUTS_EXCL(GW_DEBUG, "");
        } else {
            FUNCTION_GUTS(GW_DEBUG, "");
        }
    }
}
コード例 #7
0
ファイル: log.c プロジェクト: frese/mbuni
void gw_panic(int err, const char *fmt, ...)
{
    /*
     * we don't want PANICs to spread accross smsc logs, so
     * this will be always within the main core log.
     */
    FUNCTION_GUTS(GW_PANIC, "");

#ifdef HAVE_BACKTRACE
    {
        void *stack_frames[50];
        size_t size, i;
        char **strings;

        size = backtrace(stack_frames, sizeof(stack_frames) / sizeof(void*));
        strings = backtrace_symbols(stack_frames, size);

        if (strings) {
            for (i = 0; i < size; i++)
                gw_panic_output(0, "%s", strings[i]);
        }
        else { /* hmm, no memory available */
            for (i = 0; i < size; i++)
                gw_panic_output(0, "%p", stack_frames[i]);
        }

        /*
         * Note: we don't free 'strings' array because gw_free could panic's and we
         *       have endless loop with SEGFAULT at the end. And this doesn't care
         *       us in any case, because we are panic's and exiting immediately. (alex)
         */
    }
#endif

#ifdef SEGFAULT_PANIC
    *((char*)0) = 0;
#endif

    exit(EXIT_FAILURE);
}
コード例 #8
0
static void PRINTFLIKE(2,3) gw_panic_output(int err, const char *fmt, ...)
{
    FUNCTION_GUTS(GW_PANIC, "");
}
コード例 #9
0
ファイル: log.cpp プロジェクト: daoopp/mse
void info(int e, const char *fmt, ...) 
{
   FUNCTION_GUTS(OS_INFO, "");
}
コード例 #10
0
ファイル: log.cpp プロジェクト: daoopp/mse
void warning(int e, const char *fmt, ...) 
{
    FUNCTION_GUTS(OS_WARNING, "");
}
コード例 #11
0
ファイル: log.cpp プロジェクト: daoopp/mse
void error(int e, const char *fmt, ...) 
{
    FUNCTION_GUTS(OS_ERROR, "");
}
コード例 #12
0
ファイル: log.cpp プロジェクト: daoopp/mse
void panic(int e, const char *fmt, ...) 
{
    FUNCTION_GUTS(OS_PANIC, "");
    exit(EXIT_FAILURE);
}