gmyth/src/gmyth_debug.c
author rosfran
Wed May 23 19:50:41 2007 +0100 (2007-05-23)
branchtrunk
changeset 701 2f28edb4d804
parent 698 9019388af980
child 750 312d6bc514f3
permissions -rw-r--r--
[svn r707] Fixed the wrong commentary indentation.
     1 /**
     2  * GMyth Library
     3  *
     4  * @file gmyth/gmyth_debug.c
     5  * 
     6  *
     7  * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
     8  * @author Renato Filho <renato.filho@indt.org.br>
     9  *
    10  * 
    11  * This program is free software; you can redistribute it and/or modify
    12  * it under the terms of the GNU Lesser General Public License as published by
    13  * the Free Software Foundation; either version 2 of the License, or
    14  * (at your option) any later version.
    15  *
    16  * This program is distributed in the hope that it will be useful,
    17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    19  * GNU General Public License for more details.
    20  *
    21  * You should have received a copy of the GNU Lesser General Public License
    22  * along with this program; if not, write to the Free Software
    23  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    24  */
    25 
    26 #ifdef HAVE_CONFIG_H
    27 #include "config.h"
    28 #endif
    29 
    30 #include "gmyth_debug.h"
    31 
    32 void
    33 gmyth_debug_real ( const char *func,
    34                    const char *file, const int line, gboolean newline,
    35                    const char *format, ... )
    36 {
    37     va_list args;
    38     char buffer[1025];
    39     char str_time[255];
    40     time_t the_time;
    41 
    42     va_start ( args, format );
    43 
    44     g_vsnprintf ( buffer, 1024, format, args );
    45 
    46     va_end ( args );
    47 
    48     time ( &the_time );
    49     strftime ( str_time, 254, "%H:%M:%S", localtime ( &the_time ) );
    50 
    51     g_printerr ( newline ? "(%s) [%p] [%s] %s:%d: %s\n" :
    52                  "(%s) [%p] [%s] %s:%d: %s", str_time, g_thread_self (  ), func,
    53                  file, line, buffer );
    54 }