Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thlorenz/pretty-trace
Prettifies traces emitted by tools like lldb.
https://github.com/thlorenz/pretty-trace
Last synced: 2 months ago
JSON representation
Prettifies traces emitted by tools like lldb.
- Host: GitHub
- URL: https://github.com/thlorenz/pretty-trace
- Owner: thlorenz
- License: mit
- Created: 2014-11-24T18:46:07.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-12-01T16:27:43.000Z (about 10 years ago)
- Last Synced: 2024-10-18T00:28:26.854Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 633 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pretty-trace [![build status](https://secure.travis-ci.org/thlorenz/pretty-trace.png)](http://travis-ci.org/thlorenz/pretty-trace)
[![testling badge](https://ci.testling.com/thlorenz/pretty-trace.png)](https://ci.testling.com/thlorenz/pretty-trace)
Prettifies traces emitted by tools like lldb.
```js
var prettyTrace = require('pretty-trace');var lines = fs.readFileSync(__dirname + '/test/fixtures/lldb-trace.txt', 'utf8').split('\n');
var prettyLines = prettyTrace.lines(lines, prettyTrace.terminalTheme);
console.log(prettyLines.join('\n'))
```![lldb-trace](https://raw.githubusercontent.com/thlorenz/pretty-trace/master/assets/lldb-trace.png)
## CLI
```
cat ./test/fixtures/lldb-trace.txt | pretty-trace
```## Installation
npm install pretty-trace
*Used by [resolve-jit-symbols](http://thlorenz.github.io/resolve-jit-symbols/web/)*.
prettyTrace::htmlThemeA theme that surrounds the given trace using with spans classed
trace-*
in order to allow styling with CSS.
- Source:
prettyTrace::regexes::instrumentsRegexes used to match callgraphs generated with Mac Instruments.
- Source:
prettyTrace::regexes::lldbRegexes used to match debug traces created by tools like lldb.
- Source:
prettyTrace::regexes::perfRegexes used to match callgraphs generated running Linux perf, i.e.
perf script
.
- Source:
prettyTrace::terminalThemeA theme that colorizes the given trace using ANSI color codes.
- Source:
prettyTrace::line(line, theme) → {string}Prettifies the given line.
Parameters:
Name
Type
Description
line
string
the line to be prettified
theme
Object
theme that specifies how to prettify a trace
Properties
Name
Type
Description
raw
function
invoked to surround an unparsable line
frame
function
invoked to surround the frame number
address
function
invoked to surround the hex address
symbol
function
invoked to surround the symbol corresponding to the address, i.e. a function name
location
function
invoked to surround the location in the file at which the symbol is found
- Source:
Returns:
prettified line
Type
string
prettyTrace::lines(lines, theme) → {Array.<string>}Prettifies multiple lines.
Parameters:
Name
Type
Description
lines
Array.<string>
lines to be prettified
theme
Object
theme that specifies how to prettify a trace @see prettyTrace::line
- Source:
Returns:
the prettified lines
Type
Array.<string>*generated with [docme](https://github.com/thlorenz/docme)*
## License
MIT