You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit afe6a41
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.md
+30-13Lines changed: 30 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,28 +84,45 @@ The vsix package can be installed within the VS Code extensions.
84
84
85
85
The `log2src` crate can be used as a library. Full API documentation is available at [docs.rs/log2src](https://docs.rs/log2src).
86
86
87
-
```rust
88
-
uselog2src::{LogMatcher, LogRefBuilder};
89
-
usestd::path::Path;
87
+
Start by creating a `LogMatcher` and adding the directories containing the source files that produced the logs. After discovering the source, read the log file one line at a time and turn each line into a `LogRef`.
88
+
89
+
The log format must contain a named `body` capture. The simple format below treats the entire line as the message body; replace it with a regular expression that matches your application's log format when needed. Each matching log statement returns its source location and any values that can be reconstructed from the logged arguments.
For multiline log messages or logs that include source hints such as a file and line number, define additional named captures in the format. Supported captures include `timestamp`, `thread`, `file`, `line`, `method`, `level`, and `body`.
126
+
110
127
## Contributing
111
128
This is mostly a hobby project worked on during nights and weekends, so to minimize project management I'm not looking for pull requests at the moment. Feel free to file an issue to discuss bugs, ideas, or other interest in the project.
0 commit comments