Skip to content

Commit

Permalink
Port "Search" page
Browse files Browse the repository at this point in the history
Issue: #175
  • Loading branch information
mlopatkin committed Dec 30, 2023
1 parent 6f241ab commit 136849c
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/site/content/_index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ live from a device or an emulator, or log and dumpstate files.

* [Display logs from a device or an emulator](/adb_mode)
* Display saved logs and dumpstate files
* Search in the logs using regex if needed
* [Search in the logs using regex if needed](/search)
* Filter log lines by tag, PID, log priority, message content
* Filtered lines can be hidden, highlighted or shown in a separate window
* Bookmarks
Expand Down
2 changes: 1 addition & 1 deletion docs/site/content/adb_mode/_index.en.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Working with a device or an emulator
weight: 30
weight: 20
---
AndLogView can display logs directly from an emulator or a device if you have
the Android SDK installed. Simply run a launching script and the AndLogView
Expand Down
4 changes: 2 additions & 2 deletions docs/site/content/install/_index.en.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Installation
weight: 20
title: Installing
weight: 10
---

## Requirements
Expand Down
70 changes: 70 additions & 0 deletions docs/site/content/search/_index.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
title: Searching
weight: 30
---
You can search for the pattern occurences in tag, application name, and message
fields.
Press <kbd><kbd>Ctrl</kbd><kbd>F</kbd></kbd>, enter the pattern in the appeared
text field and press <kbd><kbd>Enter</kbd></kbd> to start searching.

![Search field](search_field.png)

Search starts from the current selected log line of from the beginning if no line is selected.

All occurences of the pattern are highlighted (and in the tooltip too)

![Search results](search_results.png)

Use <kbd><kbd>F3</kbd></kbd> and <kbd><kbd>Shift</kbd><kbd>F3</kbd></kbd> to navigate between search result forward and backward.

If there is no more occurences of the pattern in the given direction from the
selected line then the message appears in the status bar.

![Search showing "Text not found"](search_not_found.png)

Use <kbd><kbd>Esc</kbd></kbd> to stop search and clear highlighting.

Simple text search is case-insesitive.

## Regular expressions

You can search using regular expressions. To do that wrap your pattern in
slashes (`/.../`). For example, `/^[Aa]/` looks up all lines that start with
lower or upper 'a'.

Regex-based search is case-sensitive.

Standard [Java regular expression syntax][java_pattern] is used.

<!-- TODO(mlopatkin) link to filtering page when it is ready -->
You can use regular expressions in tag, application name, and message filters
too.

## Limiting search scope

By default, all available searchable fields (tag, application name, and message)
are looked for matches. You can limit the scope with a prefix:

- `tag:` to only look in tags
- `app:` to only look in application names
- `msg:` to only look in messages

For example, when searching for `app:android`, messages that contain `android`
aren't highlighted:
![Search with prefix](search_with_prefix.png)


Only a single prefix is supported, so you cannot specify, for example,
`app:tag:foo` to look in both app names and tags. In fact, `tag:` would be
treated as part of the search pattern.

Regular expression can also be prefixed, like `tag:/(Foo|Bar)/`.

## Limitations

It is not possible to use simple search to search for spaces, tabs or other
blank characters. Should you need this, you can use regular expression search as
a workaround: `/[ ]/`. Note that using just space inside slashes, like `/ /`
doesn't work too, as blank regular expressions are not supported.

[java_pattern]: http://download.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html
Binary file added docs/site/content/search/search_field.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/site/content/search/search_not_found.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/site/content/search/search_results.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/site/content/search/search_with_prefix.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 136849c

Please sign in to comment.