uifw/AvKon/notifsrc/akntrace.cpp
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 2002 - 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:  Avkon Trace
       
    15 *
       
    16 */
       
    17 
       
    18 #include "akntrace.h"
       
    19 #include <e32base.h>
       
    20 #include <e32debug.h>
       
    21 
       
    22 NONSHARABLE_CLASS(TOverflowTruncate8) : public TDes8Overflow
       
    23     {
       
    24 public:
       
    25     void Overflow(TDes8& /*aDes*/) {}
       
    26     };
       
    27 
       
    28 NONSHARABLE_CLASS(TOverflowTruncate16) : public TDes16Overflow
       
    29     {
       
    30 public:
       
    31     void Overflow(TDes16& /*aDes*/) {}
       
    32     };
       
    33 
       
    34 
       
    35 EXPORT_C void AknTracePrint(TRefByValue<const TDesC16> aFmt, ...)
       
    36     {
       
    37     TOverflowTruncate16 overflow;
       
    38     VA_LIST list;
       
    39     VA_START(list, aFmt);
       
    40     TBuf<KAknTraceMaxLength> tmpBuf;
       
    41     tmpBuf.AppendFormatList(aFmt, list, &overflow);
       
    42     
       
    43     RDebug::Print(_L("%S"), &tmpBuf);
       
    44     }
       
    45 
       
    46 
       
    47 EXPORT_C void AknTracePrint(const char* aFmt, ...)
       
    48     {
       
    49     TOverflowTruncate8 overflow;
       
    50     TBuf8<KAknTraceMaxLength> tmpBuf;
       
    51     TPtrC8 fmt((unsigned char*)aFmt);
       
    52     
       
    53     VA_LIST list;
       
    54     VA_START(list, aFmt);
       
    55     tmpBuf.AppendFormatList(fmt, list, &overflow);
       
    56     
       
    57     RDebug::RawPrint(tmpBuf);
       
    58     }