×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Jul 2008
    Posts
    416

    CLogFilter with KLogShortMessageEventTypeUid

    Hi guys,
    I'm having problems with this enum value. I can catch all events using e.g. KLogCallEventTypeUid but if I switch to KLogShortMessageEventTypeUid it is not catching any event related to sms's. The sms log entries are still present in the log folder (Tools->Log->go to second tab).


    Code:
        iLogClient = CLogClient::NewL( iFsSession );
        iRecentLogView = CLogViewRecent::NewL( *iLogClient );
        iLogFilterIngoingSms = CLogFilter::NewL();
        iLogFilterOutgoingSms = CLogFilter::NewL();
        
        iLogFilterIngoingCall = CLogFilter::NewL();
        iLogFilterOutgoingCall = CLogFilter::NewL();
    
        iLogFilterList = new (ELeave) CLogFilterList();
        
        TBuf<KLogMaxDirectionLength> directionOut;
        iLogClient->GetString(directionOut, R_LOG_DIR_OUT);
        TBuf<KLogMaxDirectionLength> directionIn;
        iLogClient->GetString(directionIn, R_LOG_DIR_IN);
    
        // using this filter does not filter any event related to sms's
        iLogFilterOutgoingSms->SetDirection(directionOut);
        iLogFilterOutgoingSms->SetEventType(KLogShortMessageEventTypeUid);
        
        iLogFilterIngoingSms->SetDirection(directionIn);
        iLogFilterIngoingSms->SetEventType(KLogShortMessageEventTypeUid);
        
        iLogFilterOutgoingCall->SetDirection(directionOut);
        iLogFilterOutgoingCall->SetEventType(KLogCallEventTypeUid);
    
        iLogFilterIngoingCall->SetDirection(directionIn);
        iLogFilterIngoingCall->SetEventType(KLogCallEventTypeUid);
        
        // if I use composed filters, again only calls are properly fitlered
        iLogFilterList->AppendL(iLogFilterOutgoingSms);
        iLogFilterList->AppendL(iLogFilterIngoingSms);
        iLogFilterList->AppendL(iLogFilterOutgoingCall);
        iLogFilterList->AppendL(iLogFilterIngoingCall);
    I'm using filters with iRecentLogView:

    Code:
    iRecentLogView->SetRecentListL(KLogNullRecentList, *iLogFilterList, iStatus)
    Should I use another api instance like iLogViewEvent->SetFilterL(*iLogFilter,iStatus)? What is the relation between CLogViewEvent and CRecentLogView, it seems that just iRecentLogView->Event(). Can I get the sms log entry with:

    Code:
    iRecentLogView->PreviousL(iStatus)
    ?

  2. #2
    Regular Contributor
    Join Date
    Jul 2008
    Posts
    416

    Re: CLogFilter with KLogShortMessageEventTypeUid

    I need online notification about events in the log. And I need to observe bothe the recent and normal events. Since CLogViewEvent and CLogViewRecent issue two different requests, it looks like I must implement two different AO's. This code is from Nokia wiki: I hope the CLogViewEvent is capable to catch the KLogShortMessageEventTypeUid events.

    Code:
    void CLogExEngine::ReadEventsL()
    	{	
    	Cancel();
    
    	// ETrue if there are any events in the log view
    	if(iLogViewEvent->SetFilterL(*iLogFilter,iStatus))
    	{
    		// set this active object active to get the events 
    		// from the main event database, see RunL()
    		iTask = EGetEvent;
    		SetActive();
    	}
    //	else
    //	{  // No any events in the log view
    //		iTask=ENoEvent;
    //		SetActive();
    //	}
    	// If there are no events in the main event database, 
    	// do nothing and return
    	}
    	
    // ----------------------------------------------------
    // CLogExEngine::ReadRecentEventsL()
    // Reads recents events from main event database
    // ----------------------------------------------------
    //
    void CLogExEngine::ReadRecentEventsL()
    	{	
    	Cancel();
    
    	// ETrue if there are any events in the log view
    	if(iLogViewRecent->SetRecentListL(KLogNullRecentList, iStatus))
    		{
    		// set this active object active to get the events 
    		// from the main event database, see RunL()
    		iTask = EGetRecent;
    		SetActive();
    		}
    	// If there are no events in the main event database, 
    	// do nothing and return
    	}

    I'll try this.

  3. #3
    Regular Contributor
    Join Date
    Jul 2008
    Posts
    416

    Re: CLogFilter with KLogShortMessageEventTypeUid

    So instead of CLogViewRecent I had to use CLogViewEvent. I have created another AO with iLogFilterList described below. The AO using CLogViewEvent is in fact copy of the AO with CLogViewRecent except these changes:

    Registration of the filter:



    Code:
        if(iLogViewEvent)
        {       
            iState = EReadingLog;
            iLogViewEvent->Cancel();
            //set here the filter 
            if( iLogViewEvent->SetFilterL(*iLogFilterList, iStatus) )
            {
                SetActive();
            }
            else
            {
                StartMonitorL();
            }
        }
    AND DELETION of the event:

    Code:
        if ( iLogViewEvent )
        {
            iState = EDeletingEvent;
            if ( iLogClient )
            {
                const_cast< CLogEvent& > ( iLogViewEvent->Event() ).SetFlags( KLogFlagsMask | KLogEventRead );
                TLogId tmpId = iLogViewEvent->Event().Id(); 
                iLogClient->DeleteEvent( tmpId, iStatus );
                
                SetActive();
            }
        }
    It works. I had such a notion that sms log is not caught as the recent event. It is not described in the documentation. You must have registered also the devicewrite capability.

Similar Threads

  1. Replies: 1
    Last Post: 2009-01-12, 18:01
  2. Clearing CLogFilter?
    By vilvo in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2005-05-26, 13:08
  3. CLogViewRecent with CLogFilter
    By kklaine in forum Symbian
    Replies: 1
    Last Post: 2004-04-15, 12:36
  4. Replies: 0
    Last Post: 2003-07-26, 01:06
  5. Replies: 0
    Last Post: 2003-07-26, 01:05

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×