sbsv2/raptor/util/talon/log.c
changeset 2 39c28ec933dd
child 13 c327db0664bb
equal deleted inserted replaced
1:820b22e13ff1 2:39c28ec933dd
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #include "log.h"
       
    22 #include <stdarg.h>
       
    23 #include <stdio.h>
       
    24 
       
    25 int loglevel=LOGNORMAL;
       
    26 int debug(const char *format, ...)
       
    27 {
       
    28 	int rt=0;
       
    29 	
       
    30 	if (loglevel >= LOGDEBUG)
       
    31 	{
       
    32 		va_list ap;
       
    33 		va_start(ap, format);
       
    34 		rt = vfprintf(stderr, format,  ap);
       
    35 		va_end(ap);
       
    36 
       
    37 	}
       
    38 
       
    39 	return rt;
       
    40 }
       
    41 
       
    42 
       
    43 int error(const char *format, ...)
       
    44 {
       
    45 	int rt=0;
       
    46 	
       
    47 	if (loglevel >= LOGNORMAL)
       
    48 	{
       
    49 		va_list ap;
       
    50 		va_start(ap, format);
       
    51 		rt = vfprintf(stderr, format,  ap);
       
    52 		va_end(ap);
       
    53 
       
    54 	}
       
    55 
       
    56 	return rt;
       
    57 }