|
19 | 19 | if os.environ.get("_TYPER_COMPLETE_ARGS", False): |
20 | 20 | warnings.filterwarnings("ignore") |
21 | 21 |
|
22 | | -import typer |
23 | | -from typing_extensions import Annotated |
24 | | - |
25 | | -from crytic_compile import CryticCompile, InvalidCompilation |
26 | | -from crytic_compile import compile_all, is_supported |
27 | | - |
28 | | -from slither.detectors import all_detectors |
29 | | -from slither.detectors.abstract_detector import AbstractDetector |
30 | | -from slither.detectors.classification import DetectorClassification |
31 | | -from slither.printers import all_printers |
32 | | -from slither.printers.abstract_printer import AbstractPrinter |
33 | | -from slither.slither import Slither |
34 | | -from slither.utils.output import ( |
| 22 | +# Configure logging BEFORE importing crytic_compile to suppress INFO messages |
| 23 | +logging.basicConfig() |
| 24 | +logging.getLogger("CryticCompile").setLevel(logging.WARNING) |
| 25 | + |
| 26 | +import typer # noqa: E402 |
| 27 | +from typing_extensions import Annotated # noqa: E402 |
| 28 | + |
| 29 | +from crytic_compile import CryticCompile, InvalidCompilation # noqa: E402 |
| 30 | +from crytic_compile import compile_all, is_supported # noqa: E402 |
| 31 | + |
| 32 | +from slither.detectors import all_detectors # noqa: E402 |
| 33 | +from slither.detectors.abstract_detector import AbstractDetector # noqa: E402 |
| 34 | +from slither.detectors.classification import DetectorClassification # noqa: E402 |
| 35 | +from slither.printers import all_printers # noqa: E402 |
| 36 | +from slither.printers.abstract_printer import AbstractPrinter # noqa: E402 |
| 37 | +from slither.slither import Slither # noqa: E402 |
| 38 | +from slither.utils.output import ( # noqa: E402 |
35 | 39 | Output, |
36 | 40 | ZipType, |
37 | 41 | OutputFormat, |
|
42 | 46 | output_detectors_json, |
43 | 47 | output_printers, |
44 | 48 | ) |
45 | | -from slither.utils.output_capture import StandardOutputCapture |
46 | | -from slither.utils.colors import red, set_colorization_enabled |
47 | | -from slither.utils.command_line import ( |
| 49 | +from slither.utils.output_capture import StandardOutputCapture # noqa: E402 |
| 50 | +from slither.utils.colors import red, set_colorization_enabled # noqa: E402 |
| 51 | +from slither.utils.command_line import ( # noqa: E402 |
48 | 52 | FailOnLevel, |
49 | 53 | defaults_flag_in_config, |
50 | 54 | DEFAULT_JSON_OUTPUT_TYPES, |
|
59 | 63 | target_type, |
60 | 64 | read_config_file, |
61 | 65 | ) |
62 | | -from slither.exceptions import SlitherException |
| 66 | +from slither.exceptions import SlitherException # noqa: E402 |
63 | 67 |
|
64 | | -logging.basicConfig() |
65 | 68 | logger = logging.getLogger("Slither") |
66 | 69 |
|
67 | | - |
68 | 70 | app = SlitherApp("detect", rich_markup_mode="markdown", result_callback=slither_end_callback) |
69 | 71 |
|
70 | 72 | # Because the app will be used by the tools to add commands, we need to define it before importing them |
@@ -1097,14 +1099,14 @@ def configure_logger(log_level: int = logging.INFO): |
1097 | 1099 | logging.getLogger(logger_name).setLevel(log_level) |
1098 | 1100 |
|
1099 | 1101 | console_handler = logging.StreamHandler() |
1100 | | - console_handler.setLevel(logging.INFO) |
| 1102 | + console_handler.setLevel(logging.WARNING) |
1101 | 1103 |
|
1102 | 1104 | console_handler.setFormatter(FormatterCryticCompile()) |
1103 | 1105 |
|
1104 | 1106 | crytic_compile_error = logging.getLogger("CryticCompile") |
1105 | 1107 | crytic_compile_error.addHandler(console_handler) |
1106 | 1108 | crytic_compile_error.propagate = False |
1107 | | - crytic_compile_error.setLevel(logging.INFO) |
| 1109 | + crytic_compile_error.setLevel(logging.WARNING) |
1108 | 1110 |
|
1109 | 1111 |
|
1110 | 1112 | def main(): |
|
0 commit comments