Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
cocolato committed Feb 28, 2024
1 parent ae6a36b commit fa8b229
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ It's a fork/optimized version from [elifiner/pydump](https://github.com/elifiner
* Optimize code structure && remove redundant code
* fix bug in python2.7 && support python3.10+
* supported more pdb commnd
* a useful command line tool for debug


Pydumpling writes the `python current traceback` into a file and
Expand Down Expand Up @@ -125,5 +126,33 @@ Type "help", "copyright", "credits" or "license" for more information.
10 -> inner()
(Pdb)
```

### Use Command Line

Use command line to print the traceback:
`python -m pydumpling --print test.deump`

It will print:
```python
Traceback (most recent call last):
File "/workspaces/pydumpling/tests/test_dump.py", line 20, in test_dumpling
outer()
File "/workspaces/pydumpling/tests/test_dump.py", line 14, in outer
inner()
File "/workspaces/pydumpling/tests/test_dump.py", line 10, in inner
c = a + b # noqa: F841
TypeError: unsupported operand type(s) for +: 'int' and 'str'
```


Use command line to do pdb debug:
`python -m pydumpling --debug test.deump`

It will open the pdb window:
```python
-> c = a + b
(Pdb)
```

## TODO
- []
28 changes: 28 additions & 0 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* 优化代码结构, 去除冗余代码
* 修复其在2.7及3.10版本中的bug
* 支持更多的pdb命令
* 提供了一个方便用来调试的命令行工具

pydumpling可以在代码的任何位置中,将当前Python程序的traceback写到一个文件中,可以稍后在Python调试器中加载它。目前pydump支持很多兼容PDB api的调试器(pdbpp, udb, ipdb)

Expand Down Expand Up @@ -122,5 +123,32 @@ Type "help", "copyright", "credits" or "license" for more information.
(Pdb)
```

### 命令行使用

使用命令行来打印traceback:
`python -m pydumpling --print test.deump`

将会输出:
```python
Traceback (most recent call last):
File "/workspaces/pydumpling/tests/test_dump.py", line 20, in test_dumpling
outer()
File "/workspaces/pydumpling/tests/test_dump.py", line 14, in outer
inner()
File "/workspaces/pydumpling/tests/test_dump.py", line 10, in inner
c = a + b # noqa: F841
TypeError: unsupported operand type(s) for +: 'int' and 'str'
```


使用命令行来进行pdb调试:
`python -m pydumpling --debug test.deump`

将会打开pdb调试会话:
```python
-> c = a + b
(Pdb)
```

## TODO
- []

0 comments on commit fa8b229

Please sign in to comment.