https://github.com/johnsonlee/trace-parser
A parser collection for Java/Native stack trace
https://github.com/johnsonlee/trace-parser
Last synced: about 1 year ago
JSON representation
A parser collection for Java/Native stack trace
- Host: GitHub
- URL: https://github.com/johnsonlee/trace-parser
- Owner: johnsonlee
- License: apache-2.0
- Created: 2021-02-01T19:24:30.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2022-09-02T13:34:23.000Z (almost 4 years ago)
- Last Synced: 2025-03-28T23:51:11.942Z (about 1 year ago)
- Language: Kotlin
- Homepage:
- Size: 139 KB
- Stars: 12
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Introduction
A parser for Java stack trace, Android trace.txt and tombstone file parsing, usually used for issue aggregation in APM system.
## Usage
### Parse Java stack trace
```kotlin
val trace = JavaStackTraceParser().parse(Log.getStackTrace(e))
val rootCause = trace.rootCause
```
### Parse trace file
```kotlin
val trace = TraceFile.from(path)
val rootCause = trace.rootCause
```
or
```kotlin
val trace = FileReader(file).use {
TraceFileParser(it).parse()
}
val rootCause = trace.rootCause
```
### Parse Android tombstone file
```kotlin
val tombstone = TombstoneFile.from(path)
val rootCause = tombstone.rootCause
```
or
```kotlin
val tombstone = FileReader(file).use {
TombstoneFileParser(it).parse()
}
val rootCause = tombstone.rootCause
```
### Gradle
```kotlin
implementation("io.johnsonlee:trace-parser:$trace_parser_version")
```