imagehandlingutilities/thumbnailmanager/inc/thumbnaillog.h
changeset 54 48dd0f169f0d
parent 42 2e2a89493e2b
equal deleted inserted replaced
42:2e2a89493e2b 54:48dd0f169f0d
     1 /*
       
     2 * Copyright (c) 2006-2007 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 "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:  Logging functions
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef THUMBNAILLOG_H
       
    20 #define THUMBNAILLOG_H
       
    21 
       
    22 #include <e32std.h>
       
    23 #include <e32svr.h>
       
    24 
       
    25 //log to file instead of RDebug
       
    26 //#define LOG_TO_FILE
       
    27 
       
    28 //#define _DEBUG
       
    29 
       
    30 #ifdef _DEBUG
       
    31 #ifdef LOG_TO_FILE
       
    32 //
       
    33 // Log to file
       
    34 //
       
    35 #include <flogger.h>
       
    36 _LIT( KThumbnailLogDir, "thumbnail" );
       
    37 _LIT( KThumbnailLogFile, "thumbnail.txt" );
       
    38 
       
    39 #define TN_DEBUG1( s ) \
       
    40 RFileLogger::Write( \
       
    41 KThumbnailLogDir, \
       
    42 KThumbnailLogFile, \
       
    43 EFileLoggingModeAppend, \
       
    44 _L( s ) );
       
    45 
       
    46 #define TN_DEBUG2( s, a ) \
       
    47 RFileLogger::WriteFormat( \
       
    48 KThumbnailLogDir, \
       
    49 KThumbnailLogFile, \
       
    50 EFileLoggingModeAppend, \
       
    51 _L( s ), a );
       
    52 
       
    53 #define TN_DEBUG3( s, a, b ) \
       
    54 RFileLogger::WriteFormat( \
       
    55 KThumbnailLogDir, \
       
    56 KThumbnailLogFile, \
       
    57 EFileLoggingModeAppend, \
       
    58 _L( s ), a, b );
       
    59 
       
    60 #define TN_DEBUG4( s, a, b, c ) \
       
    61 RFileLogger::WriteFormat( \
       
    62 KThumbnailLogDir, \
       
    63 KThumbnailLogFile, \
       
    64 EFileLoggingModeAppend, \
       
    65 _L( s ), a, b, c );
       
    66 
       
    67 #define TN_DEBUG5( s, a, b, c, d ) \
       
    68 RFileLogger::WriteFormat( \
       
    69 KThumbnailLogDir, \
       
    70 KThumbnailLogFile, \
       
    71 EFileLoggingModeAppend, \
       
    72 _L( s ), a, b, c, d );
       
    73 
       
    74 #define TN_DEBUG6( s, a, b, c, d, e ) \
       
    75 RFileLogger::WriteFormat( \
       
    76 KThumbnailLogDir, \
       
    77 KThumbnailLogFile, \
       
    78 EFileLoggingModeAppend, \
       
    79 _L( s ), a, b, c, d, e );
       
    80 
       
    81 #define TN_DEBUG7( s, a, b, c, d, e, f ) \
       
    82 RFileLogger::WriteFormat( \
       
    83 KThumbnailLogDir, \
       
    84 KThumbnailLogFile, \
       
    85 EFileLoggingModeAppend, \
       
    86 _L( s ), a, b, c, d, e, f );
       
    87 
       
    88 #else // LOG_TO_FILE
       
    89 //
       
    90 // Log to RDebug
       
    91 //
       
    92 #define TN_DEBUG1( s )                 RDebug::Print( _L( s ) )
       
    93 #define TN_DEBUG2( s, a )              RDebug::Print( _L( s ), a )
       
    94 #define TN_DEBUG3( s, a, b )           RDebug::Print( _L( s ), a, b )
       
    95 #define TN_DEBUG4( s, a, b, c )        RDebug::Print( _L( s ), a, b, c )
       
    96 #define TN_DEBUG5( s, a, b, c, d )     RDebug::Print( _L( s ), a, b, c, d )
       
    97 #define TN_DEBUG6( s, a, b, c, d, e )  RDebug::Print( _L( s ), a, b, c, d, e )
       
    98 #define TN_DEBUG7( s, a, b, c, d, e, f )  RDebug::Print( _L( s ), a, b, c, d, e, f )
       
    99 
       
   100 #endif // LOG_TO_FILE
       
   101 
       
   102 #else // _DEBUG
       
   103 //
       
   104 // No logging
       
   105 //
       
   106 #define TN_DEBUG1( s )
       
   107 #define TN_DEBUG2( s, a )
       
   108 #define TN_DEBUG3( s, a, b )
       
   109 #define TN_DEBUG4( s, a, b, c )
       
   110 #define TN_DEBUG5( s, a, b, c, d )
       
   111 #define TN_DEBUG6( s, a, b, c, d, e )
       
   112 #define TN_DEBUG7( s, a, b, c, d, e, f )
       
   113 #endif // _DEBUG
       
   114 
       
   115 #endif // THUMBNAILLOG_H