https://github.com/perry-mitchell/logupdate
Single-line log updater for vlang
https://github.com/perry-mitchell/logupdate
Last synced: 12 months ago
JSON representation
Single-line log updater for vlang
- Host: GitHub
- URL: https://github.com/perry-mitchell/logupdate
- Owner: perry-mitchell
- License: mit
- Created: 2020-09-23T11:09:39.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-09-23T13:58:14.000Z (almost 6 years ago)
- Last Synced: 2025-01-03T13:24:13.248Z (over 1 year ago)
- Language: V
- Size: 18.6 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# logupdate
> Single-line log updater for vlang
[](https://travis-ci.org/perry-mitchell/logupdate)
Update the current terminal line by overwriting it - useful for displaying progress bars/animations while some work is done.

## Installation
Install using vpm:
```shell
v install perry_mitchell.logupdate
```
## Usage
Usage is very simple - `update` simply updates the same line over and over:
```v
import logupdate
import time
fn main() {
mut val := 0
for {
val = val + 1
if val > 9 {
val = 1
}
logupdate.update("Counter: $val")
time.sleep_ms(200)
}
}
```
Use `clear` to clear the update by setting one final value to the line (writes a new-line as well).
## Testing
Simply run `make all`.