emailservices/emaildebug/inc/cmaillogger.h
changeset 0 8466d47a6819
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     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:  File logger for commonemail. Log file size is limited. When
       
    15 *               predefined size is reached, file is replaced. 
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef CMAILLOGGER_H
       
    20 #define CMAILLOGGER_H
       
    21 
       
    22 #include <e32cmn.h>
       
    23 #include <f32file.h>
       
    24 #include <s32file.h>
       
    25 
       
    26 /**
       
    27  * File logger that logs to root of c-drive with thread name as part of file 
       
    28  * name.
       
    29  *
       
    30  */
       
    31 class CmailLogger
       
    32 {
       
    33 public:
       
    34     // writes line to log
       
    35     IMPORT_C static void Write( const TDesC8& aData );
       
    36     // releases log file
       
    37     IMPORT_C static void Close();
       
    38 };
       
    39 
       
    40 /**    
       
    41  * Log file container
       
    42  */
       
    43 class LogFile {
       
    44 public:
       
    45     // log file handle
       
    46     RFileWriteStream iFile;
       
    47     // thread name designates filename
       
    48     TBuf<20>     iThreadName;
       
    49     // current row in log file
       
    50     TInt         iLinesWritten;        
       
    51     // file server handle
       
    52     RFs          iFs;
       
    53     // log file name
       
    54     TFileName   iFileName;
       
    55     // stored default exception handler
       
    56     TExceptionHandler iHandler;
       
    57 };
       
    58 
       
    59 #endif //  CMAILLOGGER_H