-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
from pretty_verbose import VerboseMessages | ||
import time | ||
|
||
messages = VerboseMessages( | ||
level=3, | ||
scope="test", | ||
filename="messages.log" | ||
) | ||
|
||
messages.debug("This is a debug message.") | ||
messages.error("This is an error message.") | ||
messages.warning("This is a warning message.") | ||
messages.success("This is a success message.") | ||
messages.info("This is an info message.") | ||
|
||
for i in range(50): | ||
if i % 10 == 0: | ||
messages.for_message("This is an info message inside a for loop.") | ||
messages.progress("This is a progress message.", (i+1)/50) | ||
time.sleep(0.01) | ||
messages.end_progress("Loop.") | ||
|
||
|
||
messages.debug("This ", "is ", "a ", "debug ", "message.") | ||
messages.debug("Trying numbers", 0, 1, 0.1) | ||
messages.debug("Trying lists", ["A", 0, 1.5]) | ||
|
||
messages.error("This ", "is ", "a ", "error ", "message.") | ||
messages.error("Trying numbers", 0, 1, 0.1) | ||
messages.error("Trying lists", ["A", 0, 1.5]) | ||
|
||
messages.warning("This ", "is ", "a ", "warning ", "message.") | ||
messages.warning("Trying numbers", 0, 1, 0.1) | ||
messages.warning("Trying lists", ["A", 0, 1.5]) | ||
|
||
messages.success("This ", "is ", "a ", "success ", "message.") | ||
messages.success("Trying numbers", 0, 1, 0.1) | ||
messages.success("Trying lists", ["A", 0, 1.5]) | ||
|
||
messages.info("This ", "is ", "a ", "ifo ", "message.") | ||
messages.info("Trying numbers", 0, 1, 0.1) | ||
messages.info("Trying lists", ["A", 0, 1.5]) | ||
|
||
user_input = messages.input("Hola") | ||
messages.info("You answered: " + user_input) | ||
|
||
b_continue = messages.confirm("Confirm message", "Do you want to continue?") | ||
|
||
messages.info(f"You continued: {b_continue}") |