Skip to content

Commit dff7858

Browse files
committed
fixed format and grammar
1 parent d4bc3d2 commit dff7858

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -630,11 +630,11 @@ RuntimeError: Too much laughing with a=haha and b=hihi
630630
This handler is mainly to solve the problem of outputting a tremendous amount of logs to GUI applications in real-time.
631631

632632
GUI applications use threading to display content while listening for user input (button click, key pressing, mouse scroll).
633-
But since python actually running only one thread at a time due to the GIL (global interpreter lock),
633+
But since cpython actually running only one thread at a time due to the GIL (global interpreter lock),
634634
processing to display a tremendous amount of logs to the GUI widget will lock a thread for quite a long time.
635635
During this time, no user input will be handled and the app seems unresponsive.
636636

637-
The answer to this problem is to cache the log and output them at once after some interval or number of cached lines reached a threshold.
637+
The answer to this problem is to cache the log and output them at once after some interval or a number of cached lines reached a threshold.
638638
This significantly reduces the overhead on the widget side and makes the app responsive.
639639
The solution is implemented in the new `StreamHandlerWithBuffer` which is inside `logger_tt.handlers`.
640640
There are 2 steps to use this handler.
@@ -665,7 +665,7 @@ RuntimeError: Too much laughing with a=haha and b=hihi
665665
For `buffer_line`, to avoid the last lines of log not printed out as the number of line is below threshold,
666666
you should set `buffer_time` to a certain number too.
667667

668-
Then, you also need to add this handler to the root logger's handlers.
668+
Then, you need to add this handler to the `root` logger's `handlers` list.
669669

670670

671671
* replace the `stream`:
@@ -769,13 +769,13 @@ handlers:
769769
when: midnight
770770
771771
buffer_stream_handler:
772-
class: logger_tt.handlers.StreamHandlerWithBuffer
773-
level: DEBUG
774-
formatter: brief
775-
stream: ext://sys.stdout
776-
buffer_time: 0.5
777-
buffer_lines: 0
778-
debug: False
772+
class: logger_tt.handlers.StreamHandlerWithBuffer
773+
level: DEBUG
774+
formatter: brief
775+
stream: ext://sys.stdout
776+
buffer_time: 0.5
777+
buffer_lines: 0
778+
debug: False
779779
780780
loggers:
781781
urllib3:
@@ -842,13 +842,13 @@ logger_tt:
842842
},
843843
844844
"buffer_stream_handler": {
845-
"class": "logger_tt.handlers.StreamHandlerWithBuffer",
846-
"level": "INFO",
847-
"formatter": "simple",
848-
"stream": "ext://sys.stdout",
849-
"buffer_time": 0.5,
850-
"buffer_lines": 0,
851-
"debug": false
845+
"class": "logger_tt.handlers.StreamHandlerWithBuffer",
846+
"level": "INFO",
847+
"formatter": "simple",
848+
"stream": "ext://sys.stdout",
849+
"buffer_time": 0.5,
850+
"buffer_lines": 0,
851+
"debug": false
852852
}
853853
},
854854

0 commit comments

Comments
 (0)