Creating and Using Custom Filters with Readlog (Windows Embedded CE 6.0)
1/5/2010
Readlog provides some predefined filters through the -f
command-line parameter. Readlog filters are similar to CeLog zones, but Readlog filters modify the way the log file is processed for viewing, rather than modifying the data that is stored in the log file.
For more information about pre-defined filters for Readlog, see Readlog Command-Line Options.
If you wish to expand the number of filtering options that are available, you can create custom filter parameters for Readlog by setting values in the registry. Each filter prevents one or more CeLog event types from being displayed in the output text file. You can use custom filters to remove predefined operating system events or to remove your own custom events.
The Readlog registry values are located under the HKEY_CURRENT_USER\SOFTWARE\Microsoft\CeLog Reader\Filters key.
To use a custom filter with Readlog
Open the registry of your development workstation.
Navigate to the HKEY_CURRENT_USER\SOFTWARE\Microsoft\CeLog Reader\Filters key.
Define a registry key for your filter as follows
<FilterKey>="hexID1,hexID2,hexID3,..."
Where <FilterKey> is a single character key, and is case-sensitive. Each hexID value is a CeLog event ID representing an event type to remove from the output file whenever the user invokes Readlog with your custom filter.
Open a command window.
Navigate to the flat release directory.
To have Readlog use the filter you created in step 3, at the command prompt, type
Readlog -f <FilterKey> celog.clg MyOutput.txt
Where <FilterKey> is the filter value you defined in step 3, and MyOutput*.*txt is the output text file you want Readlog to create.
Open MyOutput.txt using a text editor such as Notepad.
Example
For example, to add a filter named A to remove events 239 and 564 (which are represented in hexadecimal as 0x123 and 0x234, respectively), add a string value named A in the registry, with value "0x123,0x234". To use this filter with Readlog, type
Readlog -f A celog.clg MyOutput.txt
The resulting MyOutput.txt file will not contain the events that have ID 239 or 564.