mmappcomponents/playbackhelper/inc/playbackhelper_log.h
changeset 20 b1fb57be53fe
parent 0 a2952bb97e68
child 25 d881023c13eb
child 55 6c1dfe4da5dd
equal deleted inserted replaced
4:d45095c2f4f3 20:b1fb57be53fe
     1 /*
     1 /*
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    13 *
    13 *
    14 * Description:  Debug print macros
    14 * Description:  Debug print macros
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 // Version : %version: 4 %
    18 // Version : %version: 5 %
    19 
       
    20 
       
    21 
    19 
    22 
    20 
    23 #ifndef PLAYBACKHELPER_LOG_H
    21 #ifndef PLAYBACKHELPER_LOG_H
    24 #define PLAYBACKHELPER_LOG_H
    22 #define PLAYBACKHELPER_LOG_H
    25 
    23 
    26 // INCLUDES
    24 // INCLUDES
    27 #include <e32svr.h>
    25 #include <e32svr.h>
    28 #include <e32def.h>
    26 #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 
    27 
    45 
    28 
    46 class PlaybackHelperDebug
    29 class PlaybackHelperDebug
    47 {
    30 {
    48     public:
    31     public:
    49         inline static void NullLog( TRefByValue<const TDesC16> /*aFmt*/, ... )
    32         inline static void NullLog( TRefByValue<const TDesC16> /*aFmt*/, ... )
    50         {
    33         {
    51         }
    34         }
       
    35 };
    52 
    36 
    53         inline static void FileLog( TRefByValue<const TDesC16> aFmt, ... )
    37 
    54         {
    38 #ifdef _DEBUG
    55             VA_LIST list;
    39     #define PLAYBACKHELPER_DEBUG RDebug::Print
    56             VA_START(list,aFmt);
    40 #else
    57             RFileLogger::WriteFormat( _L("PlaybackHelper"), 
    41     #define PLAYBACKHELPER_DEBUG PlaybackHelperDebug::NullLog
    58                                       _L("playbackhelper.log"),
    42 #endif
    59                                       EFileLoggingModeAppend,
    43 
    60                                       aFmt,
       
    61                                       list );
       
    62         }
       
    63 };
       
    64 
    44 
    65 #endif  // PLAYBACKHELPER_LOG_H
    45 #endif  // PLAYBACKHELPER_LOG_H
    66 
    46 
    67 // End of File
    47 // End of File