mmappcomponents/playbackhelper/inc/playbackhelper_log.h
changeset 0 a2952bb97e68
child 9 bee149131e4b
equal deleted inserted replaced
-1:000000000000 0:a2952bb97e68
       
     1 /*
       
     2 * Copyright (c) 2008 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:  Debug print macros
       
    15 *
       
    16 */
       
    17 
       
    18 // Version : %version: 4 %
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 #ifndef PLAYBACKHELPER_LOG_H
       
    24 #define PLAYBACKHELPER_LOG_H
       
    25 
       
    26 // INCLUDES
       
    27 #include <e32svr.h>
       
    28 #include <e32def.h>
       
    29 #include <flogger.h>
       
    30 
       
    31 
       
    32 
       
    33 // #define _PLAYBACKHELPER_FILE_LOGGING_
       
    34 
       
    35 #ifdef _DEBUG
       
    36     #define PLAYBACKHELPER_DEBUG RDebug::Print
       
    37 #else
       
    38     #ifdef _PLAYBACKHELPER_FILE_LOGGING_
       
    39         #define PLAYBACKHELPER_DEBUG PlaybackHelperDebug::FileLog
       
    40     #else
       
    41         #define PLAYBACKHELPER_DEBUG RDebug::Print
       
    42     #endif
       
    43 #endif 
       
    44 
       
    45 
       
    46 class PlaybackHelperDebug
       
    47 {
       
    48     public:
       
    49         inline static void NullLog( TRefByValue<const TDesC16> /*aFmt*/, ... )
       
    50         {
       
    51         }
       
    52 
       
    53         inline static void FileLog( TRefByValue<const TDesC16> aFmt, ... )
       
    54         {
       
    55             VA_LIST list;
       
    56             VA_START(list,aFmt);
       
    57             RFileLogger::WriteFormat( _L("PlaybackHelper"), 
       
    58                                       _L("playbackhelper.log"),
       
    59                                       EFileLoggingModeAppend,
       
    60                                       aFmt,
       
    61                                       list );
       
    62         }
       
    63 };
       
    64 
       
    65 #endif  // PLAYBACKHELPER_LOG_H
       
    66 
       
    67 // End of File