"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "client/log/log.py" between
pyre-check-0.0.54.tar.gz and pyre-check-0.0.55.tar.gz

About: Pyre is a performant type checker for Python (ships with Pysa, a security focused static analysis tool).

log.py  (pyre-check-0.0.54):log.py  (pyre-check-0.0.55)
# Copyright (c) Facebook, Inc. and its affiliates. # Copyright (c) Facebook, Inc. and its affiliates.
# #
# This source code is licensed under the MIT license found in the # This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree. # LICENSE file in the root directory of this source tree.
import contextlib
import copy import copy
import io import io
import logging import logging
import os import os
import re import re
import sys import sys
import threading import threading
import time import time
from types import TracebackType from types import TracebackType
from typing import Iterable, Optional, Pattern, Sequence from typing import Generator, Iterable, Optional, Pattern, Sequence
PERFORMANCE: int = 15 PERFORMANCE: int = 15
PROMPT: int = 50 PROMPT: int = 50
SUCCESS: int = 60 SUCCESS: int = 60
LOG: logging.Logger = logging.getLogger(__name__) LOG: logging.Logger = logging.getLogger(__name__)
stdout: io.StringIO = io.StringIO(newline="") stdout: io.StringIO = io.StringIO(newline="")
__handler: Optional["TimedStreamHandler"] = None __handler: Optional["TimedStreamHandler"] = None
skipping to change at line 211 skipping to change at line 212
if handler: if handler:
handler.terminate() handler.terminate()
__handler = None __handler = None
output = stdout.getvalue() output = stdout.getvalue()
if output: if output:
sys.stdout.write(output) sys.stdout.write(output)
if not output.endswith("\n"): if not output.endswith("\n"):
sys.stdout.write("\n") sys.stdout.write("\n")
@contextlib.contextmanager
def configured_logger(noninteractive: bool) -> Generator[None, None, None]:
try:
initialize(noninteractive)
yield
finally:
cleanup()
class StreamLogger: class StreamLogger:
_should_stop_reading_stream = False _should_stop_reading_stream = False
_current_section: Optional[str] _current_section: Optional[str]
_server_log_pattern: Pattern[str] = re.compile( _server_log_pattern: Pattern[str] = re.compile(
r"\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} (\w+) (.*)" r"\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} (\w+) (.*)"
) )
def __init__(self, stream: Iterable[str]) -> None: def __init__(self, stream: Iterable[str]) -> None:
self._reader = threading.Thread(target=self._read_stream, args=(stream,) ) self._reader = threading.Thread(target=self._read_stream, args=(stream,) )
 End of changes. 3 change blocks. 
1 lines changed or deleted 10 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)