radioengine/utils/api/mradioenginelogger.h
changeset 23 a2b50a479edf
parent 19 afea38384506
child 24 6df133bd92e1
equal deleted inserted replaced
19:afea38384506 23:a2b50a479edf
     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 "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 #ifndef M_RADIOENGINELOGGER_H
       
    19 #define M_RADIOENGINELOGGER_H
       
    20 
       
    21 #include <e32std.h>
       
    22 
       
    23 _LIT( KMarkerEngine, "RadioEngine:" );
       
    24 _LIT( KMarkerUi,     "RadioUI:    " );
       
    25 
       
    26 /**
       
    27  * Common interface for logger types.
       
    28  */
       
    29 NONSHARABLE_CLASS( MRadioEngineLogger )
       
    30     {
       
    31 
       
    32 public:
       
    33 
       
    34     IMPORT_C static MRadioEngineLogger* Logger();
       
    35 
       
    36     /**
       
    37      * Clear the log.
       
    38      */
       
    39     virtual MRadioEngineLogger& ClearLog() = 0;
       
    40 
       
    41     /**
       
    42      * Adds a 8-bit string to log line
       
    43      */
       
    44     virtual MRadioEngineLogger& Add( const TDesC8& aMsg ) = 0;
       
    45 
       
    46     /**
       
    47      * Adds a 16-bit string to log line
       
    48      */
       
    49     virtual MRadioEngineLogger& Add( const TDesC& aMsg ) = 0;
       
    50 
       
    51     /**
       
    52      * Adds a TInt to log line
       
    53      */
       
    54     virtual MRadioEngineLogger& Add( TInt aInt ) = 0;
       
    55 
       
    56     /**
       
    57      * Adds a TReal to log line
       
    58      */
       
    59     virtual MRadioEngineLogger& Add( const TReal& aReal ) = 0;
       
    60 
       
    61     /**
       
    62      * Adds a c-style string to log line
       
    63      */
       
    64     virtual MRadioEngineLogger& Add( const char* aText ) = 0;
       
    65 
       
    66     /**
       
    67      * Adds a pointer value to log line
       
    68      */
       
    69     virtual MRadioEngineLogger& Add( const TAny* aPtr ) = 0;
       
    70 
       
    71     /**
       
    72      * Adds a timestamp of current time to log line
       
    73      */
       
    74     virtual MRadioEngineLogger& Add( const TTime& aTime ) = 0;
       
    75 
       
    76     /**
       
    77      * Adds a timestamp of current time to log line
       
    78      */
       
    79     virtual MRadioEngineLogger& AddTimestamp() = 0;
       
    80 
       
    81     /**
       
    82      * Adds a formatted string to log line
       
    83      */
       
    84     virtual MRadioEngineLogger& AddFormat( TRefByValue<const TDesC> aFmt, ... ) = 0;
       
    85 
       
    86     /**
       
    87      * Adds the line indentation to log line
       
    88      */
       
    89     virtual MRadioEngineLogger& AddIndent( const TDesC& aMarker ) = 0;
       
    90 
       
    91     /**
       
    92      * Adds the line indentation to log line
       
    93      */
       
    94     virtual MRadioEngineLogger& AddIndentClear( const TDesC& aMarker ) = 0;
       
    95 
       
    96     /**
       
    97      * Increment indentation
       
    98      */
       
    99     virtual MRadioEngineLogger& IncIndent() = 0;
       
   100 
       
   101     /**
       
   102      * Decrement indentation
       
   103      */
       
   104     virtual MRadioEngineLogger& DecIndent() = 0;
       
   105 
       
   106     /**
       
   107      * Commits the log line to file and RDebug and resets internal buffer
       
   108      * @param aNewLine ETrue if newline is to be added, EFalse if not
       
   109      */
       
   110     virtual MRadioEngineLogger& Commit( TBool aNewLine = ETrue ) = 0;
       
   111 
       
   112     };
       
   113 
       
   114 #endif // M_RADIOENGINELOGGER_H