os/persistentdata/traceservices/tracefw/ulogger/unit_test/te-createconfig/te_clearconfig.cpp
First public contribution.
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
17 @file te_clearconfig.cpp
23 #include "te_clearconfig.h"
25 CClearConfig::~CClearConfig()
31 CClearConfig::CClearConfig()
38 void CClearConfig::ClearL(RULogger& loggerSession)
40 // CArrayPtrFlat<HBufC8> *activeplugins = new (ELeave)CArrayPtrFlat<HBufC8>(1);
41 // CleanupStack::PushL(activeplugins);
42 // loggerSession.GetActiveOutputPlugin(*activeplugins);
43 // if (activeplugins->Count())
46 // dataBuf.Copy(activeplugins->At(1)->Des());
47 // loggerSession.DeActivateOutputPlugin(dataBuf);
49 // activeplugins->ResetAndDestroy();
50 // CleanupStack::PopAndDestroy();//ptrArray
52 // CArrayFixFlat<TUint8> *getfilter = new (ELeave)CArrayFixFlat<TUint8>(1);
53 // loggerSession.GetPrimaryFilters(*getfilter);
56 // TInt Result=loggerSession.RemovePrimaryFilter(*getfilter);
58 //// CleanupStack::PopAndDestroy();//ptrArray
59 // RArray<TUint32> get2filter;
60 // loggerSession.GetSecondaryFilters(get2filter);
63 // loggerSession.RemoveSecondaryFilter(get2filter);
64 // get2filter.Close();
66 // loggerSession.SetBufferMode(1);
67 // loggerSession.ResizeTraceBufferSize(65000);
69 // loggerSession.SetDataNotificationSize(2);
71 //disable all primary filters
72 CArrayFixFlat<TUint8>* enabledPrimaryFilters = new (ELeave)CArrayFixFlat<TUint8>(1);
73 CleanupStack::PushL(enabledPrimaryFilters);
74 loggerSession.GetPrimaryFiltersEnabled(*enabledPrimaryFilters);
75 loggerSession.SetPrimaryFiltersEnabled(*enabledPrimaryFilters, false);
76 CleanupStack::PopAndDestroy(enabledPrimaryFilters);
78 //disable all secondary filters
79 RArray<TUint32> enabledSecondaryFilters;
80 CleanupClosePushL(enabledSecondaryFilters);
81 loggerSession.GetSecondaryFiltersEnabled(enabledSecondaryFilters);
82 loggerSession.SetSecondaryFiltersEnabled(enabledSecondaryFilters, false);
83 CleanupStack::PopAndDestroy(); //enabledSecondaryFilters
85 //enable filtering by secondary filter
86 loggerSession.SetSecondaryFilteringEnabled(ETrue);
88 //set buffer mode: straight, buffer-size: 65000KB, notification size: 2KB
89 loggerSession.SetBufferMode(1);
90 loggerSession.SetBufferSize(65000);
91 loggerSession.SetNotificationSize(2);