imservices/imfeatureplugin/srcutils/imlogutils.cpp
author hgs
Wed, 03 Nov 2010 09:32:20 +0530
changeset 51 61fad867f68e
permissions -rw-r--r--
201041
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
51
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* Initial Contributors:
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
*
hgs
parents:
diff changeset
    12
* Contributors:
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* Description:file for generating XImLogger
hgs
parents:
diff changeset
    15
*
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
hgs
parents:
diff changeset
    19
hgs
parents:
diff changeset
    20
// INCLUDE FILES
hgs
parents:
diff changeset
    21
#include "imlogutils.h"
hgs
parents:
diff changeset
    22
hgs
parents:
diff changeset
    23
// CONSTANTS
hgs
parents:
diff changeset
    24
const TInt KLogBufferLength = 256;
hgs
parents:
diff changeset
    25
_LIT(KImLogDir, "ximpim");
hgs
parents:
diff changeset
    26
_LIT(KImLogFile, "im.txt");
hgs
parents:
diff changeset
    27
hgs
parents:
diff changeset
    28
void XImLogger::Log(TRefByValue<const TDesC> aFmt,...)
hgs
parents:
diff changeset
    29
    {
hgs
parents:
diff changeset
    30
#ifdef _DEBUG
hgs
parents:
diff changeset
    31
    VA_LIST list;
hgs
parents:
diff changeset
    32
    VA_START(list, aFmt);
hgs
parents:
diff changeset
    33
    // Print to log file
hgs
parents:
diff changeset
    34
    TBuf<KLogBufferLength> buf;
hgs
parents:
diff changeset
    35
    buf.FormatList(aFmt, list);
hgs
parents:
diff changeset
    36
    RFileLogger::Write(KImLogDir, KImLogFile, EFileLoggingModeAppend, buf);
hgs
parents:
diff changeset
    37
#endif
hgs
parents:
diff changeset
    38
    }
hgs
parents:
diff changeset
    39
hgs
parents:
diff changeset
    40
//  End of File