Python logging made (stupidly) simple
This report presents the forensic synthetic code analysis of Delgan/loguru, a Python project with 24,013 GitHub stars. SynthScan v2.0 examined 26,581 lines of code across 286 source files, recording 533 pattern matches distributed across 10 syntactic categories. The overall adjusted score of 21.7 places this repository in the Moderate AI signal band.
The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).
This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.
Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.
This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.
The scanner identified 533 distinct pattern matches across 10 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_colorama.py | 44 | def test_stream_wrapped_on_windows_if_no_vt_support(patched, monkeypatch, patch_colorama): | CODE |
| LOW | tests/test_colorama.py | 56 | def test_stream_not_wrapped_on_windows_if_vt_support(patched, monkeypatch, patch_colorama): | CODE |
| LOW | tests/test_colorama.py | 110 | def test_github_actions_fixed(monkeypatch, patched, expected): | CODE |
| LOW | tests/test_colorama.py | 130 | def test_mintty_fixed_windows(monkeypatch, patched, expected): | CODE |
| LOW | tests/test_colorama.py | 148 | def test_dumb_term_not_colored(monkeypatch, patched, expected): | CODE |
| LOW | tests/test_colorama.py | 173 | def test_honor_no_color_standard(monkeypatch, patched, no_color, expected): | CODE |
| LOW | tests/test_colorama.py | 198 | def test_honor_force_color_standard(monkeypatch, patched, force_color, expected): | CODE |
| LOW | tests/test_colorama.py | 206 | def test_no_color_takes_precedence_over_force_color(monkeypatch): | CODE |
| LOW | tests/test_colorama.py | 232 | def test_mintty_not_fixed_linux(monkeypatch, patched, expected): | CODE |
| LOW | tests/test_colorama.py | 295 | def test_dont_wrap_if_not_original_stdout_or_stderr(monkeypatch, patched, patch_colorama): | CODE |
| LOW | tests/test_colorama.py | 305 | def test_dont_wrap_if_terminal_has_vt_support(monkeypatch, patched, patch_colorama): | CODE |
| LOW | tests/test_colorama.py | 317 | def test_dont_wrap_if_winapi_false(monkeypatch, patched, patch_colorama): | CODE |
| LOW | tests/test_colorama.py | 329 | def test_wrap_if_winapi_true_and_no_vt_support(monkeypatch, patched, patch_colorama): | CODE |
| LOW | tests/test_colorama.py | 342 | def test_wrap_if_winapi_true_and_vt_check_fails(monkeypatch, patched, patch_colorama): | CODE |
| LOW | tests/test_colorama.py | 355 | def test_wrap_if_winapi_true_and_stream_has_no_fileno(monkeypatch, patched, patch_colorama): | CODE |
| LOW | tests/test_colorama.py | 367 | def test_wrap_if_winapi_true_and_old_colorama_version(monkeypatch, patched, patch_colorama): | CODE |
| LOW⚡ | tests/test_filesink_rotation.py | 1122 | def test_invalid_day_rotation(rotation): | CODE |
| LOW⚡ | tests/test_filesink_rotation.py | 1130 | def test_invalid_time_rotation(rotation): | CODE |
| LOW⚡ | tests/test_filesink_rotation.py | 1136 | def test_invalid_value_size_rotation(rotation): | CODE |
| LOW⚡ | tests/test_filesink_rotation.py | 1142 | def test_invalid_unit_rotation_duration(rotation): | CODE |
| LOW⚡ | tests/test_filesink_rotation.py | 1148 | def test_invalid_value_rotation_duration(rotation): | CODE |
| LOW | tests/test_filesink_rotation.py | 191 | def test_time_rotation_with_tzinfo_diff_bigger(freeze_time, tmp_path): | CODE |
| LOW | tests/test_filesink_rotation.py | 214 | def test_time_rotation_with_tzinfo_diff_lower(freeze_time, tmp_path): | CODE |
| LOW | tests/test_filesink_rotation.py | 237 | def test_time_rotation_with_tzinfo_utc(freeze_time, tmp_path): | CODE |
| LOW | tests/test_filesink_rotation.py | 263 | def test_time_rotation_multiple_days_at_midnight_utc(freeze_time, tmp_path): | CODE |
| LOW | tests/test_filesink_rotation.py | 295 | def test_daily_rotation_with_different_timezone(freeze_time, tmp_path, offset): | CODE |
| LOW | tests/test_filesink_rotation.py | 333 | def test_time_rotation_after_positive_timezone_changes_forward(freeze_time, tmp_path, rotation): | CODE |
| LOW | tests/test_filesink_rotation.py | 360 | def test_time_rotation_when_positive_timezone_changes_forward(freeze_time, tmp_path, rotation): | CODE |
| LOW | tests/test_filesink_rotation.py | 396 | def test_time_rotation_after_negative_timezone_changes_forward(freeze_time, tmp_path, rotation): | CODE |
| LOW | tests/test_filesink_rotation.py | 423 | def test_time_rotation_when_negative_timezone_changes_forward(freeze_time, tmp_path, rotation): | CODE |
| LOW | tests/test_filesink_rotation.py | 457 | def test_time_rotation_after_positive_timezone_changes_backward_aware( | CODE |
| LOW | tests/test_filesink_rotation.py | 486 | def test_time_rotation_after_positive_timezone_changes_backward_naive( | CODE |
| LOW | tests/test_filesink_rotation.py | 524 | def test_time_rotation_after_negative_timezone_changes_backward_aware( | CODE |
| LOW | tests/test_filesink_rotation.py | 553 | def test_time_rotation_after_negative_timezone_changes_backward_naive( | CODE |
| LOW | tests/test_filesink_rotation.py | 583 | def test_time_rotation_when_timezone_changes_backward_rename_file(freeze_time, tmp_path): | CODE |
| LOW | tests/test_filesink_rotation.py | 619 | def test_dont_rotate_earlier_when_utc_is_one_day_before(freeze_time, tmp_path, rotation): | CODE |
| LOW | tests/test_filesink_rotation.py | 654 | def test_dont_rotate_later_when_utc_is_one_day_after(freeze_time, tmp_path, rotation): | CODE |
| LOW | tests/test_filesink_rotation.py | 680 | def test_rotation_at_midnight_with_date_in_filename(freeze_time, tmp_path, timezone): | CODE |
| LOW | tests/test_filesink_rotation.py | 702 | def test_time_rotation_reopening_native(tmp_path_local, delay): | CODE |
| LOW | tests/test_filesink_rotation.py | 758 | def test_time_rotation_reopening_xattr_attributeerror(tmp_path_local, monkeypatch, delay): | CODE |
| LOW | tests/test_filesink_rotation.py | 794 | def test_time_rotation_reopening_xattr_oserror(tmp_path_local, monkeypatch, delay): | CODE |
| LOW | tests/test_filesink_rotation.py | 823 | def test_time_rotation_windows_no_setctime(tmp_path, monkeypatch): | CODE |
| LOW | tests/test_filesink_rotation.py | 847 | def test_time_rotation_windows_setctime_exception(tmp_path, monkeypatch, exception): | CODE |
| LOW | tests/test_filesink_rotation.py | 915 | def test_no_rotation_at_remove(tmp_path, mode): | CODE |
| LOW | tests/test_filesink_rotation.py | 923 | def test_rename_existing_with_creation_time(freeze_time, tmp_path): | CODE |
| LOW | tests/test_filesink_rotation.py | 939 | def test_renaming_rotation_dest_exists(freeze_time, tmp_path): | CODE |
| LOW | tests/test_filesink_rotation.py | 957 | def test_renaming_rotation_dest_exists_with_time(freeze_time, tmp_path): | CODE |
| LOW | tests/test_filesink_rotation.py | 977 | def test_exception_during_rotation(tmp_path, capsys): | CODE |
| LOW | tests/test_filesink_rotation.py | 996 | def test_exception_during_rotation_not_caught(tmp_path, capsys): | CODE |
| LOW | tests/test_filesink_rotation.py | 1015 | def test_recipe_rotation_both_size_and_time(freeze_time, tmp_path): | CODE |
| LOW | tests/test_filesink_rotation.py | 1062 | def test_multiple_rotation_conditions(freeze_time, tmp_path): | CODE |
| LOW | tests/test_filesink_rotation.py | 1087 | def test_empty_rotation_condition_list(): | CODE |
| LOW | tests/test_filesink_rotation.py | 1095 | def test_invalid_rotation_type(rotation): | CODE |
| LOW | tests/test_add_option_serialize.py | 29 | def test_serialize_non_ascii_characters(): | CODE |
| LOW | tests/test_add_option_serialize.py | 60 | def test_serialize_exception_without_context(): | CODE |
| LOW | tests/test_add_option_serialize.py | 77 | def test_serialize_exception_none_tuple(): | CODE |
| LOW | tests/test_add_option_serialize.py | 94 | def test_serialize_exception_instance(): | CODE |
| LOW | tests/test_add_option_serialize.py | 111 | def test_serialize_with_catch_decorator(): | CODE |
| LOW | tests/test_add_option_serialize.py | 127 | def test_serialize_with_record_option(): | CODE |
| LOW | tests/test_add_option_serialize.py | 137 | def test_serialize_not_serializable(): | CODE |
| 369 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_opt.py | 68 | except Exception: | CODE |
| LOW | tests/test_opt.py | 82 | except Exception: | CODE |
| LOW | tests/test_opt.py | 98 | except Exception: | CODE |
| LOW | tests/test_opt.py | 114 | except Exception: | CODE |
| LOW | tests/test_interception.py | 110 | except Exception: | CODE |
| LOW | tests/test_add_option_diagnose.py | 10 | except Exception: | CODE |
| LOW | tests/test_add_option_diagnose.py | 20 | except Exception: | CODE |
| LOW | tests/test_exceptions_catch.py | 75 | except Exception: | CODE |
| LOW | tests/test_exceptions_catch.py | 91 | except Exception: | CODE |
| LOW | tests/test_add_option_enqueue.py | 263 | except Exception: | CODE |
| LOW | tests/test_add_option_enqueue.py | 286 | except Exception: | CODE |
| LOW | tests/test_propagation.py | 89 | except Exception: | CODE |
| LOW | tests/test_add_option_backtrace.py | 10 | except Exception: | CODE |
| LOW | tests/test_add_option_backtrace.py | 20 | except Exception: | CODE |
| LOW⚡ | tests/test_exceptions_formatting.py | 287 | except Exception: | CODE |
| LOW | …tions/source/backtrace/missing_lineno_frame_objects.py | 40 | except Exception as e: | CODE |
| LOW | tests/exceptions/source/backtrace/nested_wrapping.py | 32 | except Exception: | CODE |
| LOW | …exceptions/source/backtrace/nested_chained_catch_up.py | 23 | except Exception as e: | CODE |
| MEDIUM | …exceptions/source/backtrace/nested_chained_catch_up.py | 20 | def main(): | CODE |
| LOW | tests/exceptions/source/others/repeated_lines.py | 22 | except Exception: | CODE |
| LOW | tests/exceptions/source/others/one_liner_recursion.py | 15 | except Exception: | CODE |
| LOW | tests/exceptions/source/others/recursion_error.py | 20 | except Exception: | CODE |
| LOW | tests/exceptions/source/others/nested_with_reraise.py | 21 | except Exception as e: | CODE |
| MEDIUM | tests/exceptions/source/others/nested_with_reraise.py | 18 | def bar(x, y): | CODE |
| LOW | tests/exceptions/source/diagnose/chained_both.py | 16 | except Exception: | CODE |
| LOW | tests/exceptions/source/diagnose/chained_both.py | 23 | except Exception as e: | CODE |
| MEDIUM | tests/exceptions/source/diagnose/chained_both.py | 13 | def cause(x, y): | CODE |
| MEDIUM | tests/exceptions/source/diagnose/chained_both.py | 20 | def context(x, y): | CODE |
| LOW⚡ | tests/exceptions/source/modern/grouped_simple.py | 27 | except Exception as error_1: | CODE |
| LOW⚡ | tests/exceptions/source/modern/grouped_simple.py | 30 | except Exception as error_2: | CODE |
| LOW⚡ | tests/exceptions/source/modern/grouped_simple.py | 33 | except Exception as error_3: | CODE |
| MEDIUM | tests/exceptions/source/modern/grouped_simple.py | 24 | def main(): | CODE |
| LOW⚡ | …ptions/source/modern/grouped_with_cause_and_context.py | 18 | except Exception as err: | CODE |
| LOW⚡ | …ptions/source/modern/grouped_with_cause_and_context.py | 20 | except Exception as err: | CODE |
| LOW⚡ | …ptions/source/modern/grouped_with_cause_and_context.py | 25 | except Exception as err: | CODE |
| LOW⚡ | …ptions/source/modern/grouped_with_cause_and_context.py | 27 | except Exception as err: | CODE |
| LOW⚡ | …ptions/source/modern/grouped_with_cause_and_context.py | 32 | except Exception as err: | CODE |
| LOW⚡ | …ptions/source/modern/grouped_with_cause_and_context.py | 35 | except Exception: | CODE |
| MEDIUM | …ptions/source/modern/grouped_with_cause_and_context.py | 14 | def main(): | CODE |
| LOW⚡ | tests/exceptions/source/modern/grouped_nested.py | 18 | except Exception as err: | CODE |
| LOW⚡ | tests/exceptions/source/modern/grouped_nested.py | 23 | except Exception as err: | CODE |
| LOW⚡ | tests/exceptions/source/modern/grouped_nested.py | 30 | except Exception as err: | CODE |
| MEDIUM | tests/exceptions/source/modern/grouped_nested.py | 14 | def main(): | CODE |
| LOW⚡ | …ceptions/source/modern/grouped_as_cause_and_context.py | 21 | except Exception as err: | CODE |
| LOW⚡ | …ceptions/source/modern/grouped_as_cause_and_context.py | 26 | except Exception as err: | CODE |
| LOW⚡ | …ceptions/source/modern/grouped_as_cause_and_context.py | 32 | except Exception as err: | CODE |
| LOW⚡ | …ceptions/source/modern/grouped_as_cause_and_context.py | 34 | except Exception as err: | CODE |
| MEDIUM | …ceptions/source/modern/grouped_as_cause_and_context.py | 18 | def main(): | CODE |
| LOW | loguru/_better_exceptions.py | 353 | except Exception: | CODE |
| MEDIUM | loguru/_better_exceptions.py | 193 | def _get_char(self, char, default): | CODE |
| LOW | loguru/_handler.py | 207 | except Exception: | CODE |
| LOW | loguru/_handler.py | 318 | except Exception: | CODE |
| LOW | loguru/_handler.py | 333 | except Exception: | CODE |
| MEDIUM | loguru/_handler.py | 127 | def emit(self, record, level_id, from_decorator, is_raw, colored_message): | CODE |
| LOW | loguru/_colorama.py | 32 | except Exception: | CODE |
| LOW | loguru/_colorama.py | 53 | except Exception: | CODE |
| LOW | loguru/_colorama.py | 76 | except Exception: | CODE |
| LOW | loguru/_simple_sinks.py | 194 | except Exception: | CODE |
| LOW | loguru/_error_interceptor.py | 26 | except Exception: | CODE |
| LOW | loguru/_get_frame.py | 8 | except Exception: | CODE |
| 3 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | loguru/_better_exceptions.py | 72 | CODE | |
| LOW | loguru/_better_exceptions.py | 210 | CODE | |
| LOW | loguru/_better_exceptions.py | 275 | CODE | |
| LOW | loguru/_better_exceptions.py | 361 | CODE | |
| LOW | loguru/_better_exceptions.py | 401 | CODE | |
| LOW | loguru/_colorizer.py | 222 | CODE | |
| LOW | loguru/_colorizer.py | 416 | CODE | |
| LOW | loguru/_colorizer.py | 477 | CODE | |
| LOW | loguru/_handler.py | 127 | CODE | |
| LOW | loguru/_file_sink.py | 377 | CODE | |
| LOW | loguru/_logger.py | 273 | CODE | |
| LOW | loguru/_logger.py | 1182 | CODE | |
| LOW | loguru/_logger.py | 1886 | CODE | |
| LOW | loguru/_logger.py | 2053 | CODE | |
| LOW | loguru/_logger.py | 1319 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/exceptions/source/ownership/callback.py | 3 | CODE | |
| LOW | …ts/exceptions/source/ownership/assertion_from_local.py | 3 | CODE | |
| LOW | …ts/exceptions/source/ownership/assertion_from_local.py | 4 | CODE | |
| LOW | tests/exceptions/source/ownership/assertion_from_lib.py | 3 | CODE | |
| LOW | tests/exceptions/source/ownership/syntaxerror.py | 3 | CODE | |
| LOW | tests/exceptions/source/ownership/decorated_callback.py | 3 | CODE | |
| LOW | tests/exceptions/source/ownership/decorated_callback.py | 4 | CODE | |
| LOW | tests/exceptions/source/ownership/catch_decorator.py | 3 | CODE | |
| LOW | tests/exceptions/source/ownership/indirect.py | 3 | CODE | |
| LOW | …xceptions/source/ownership/catch_decorator_from_lib.py | 3 | CODE | |
| LOW | tests/exceptions/source/ownership/string_lib.py | 3 | CODE | |
| LOW | tests/exceptions/source/ownership/direct.py | 3 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_multiprocessing.py | 26 | def do_something(i): | CODE |
| LOW⚡ | tests/test_repr.py | 84 | def test_function(): | CODE |
| LOW⚡ | tests/test_repr.py | 85 | def my_function(message): | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | loguru/_better_exceptions.py | 151 | CODE | |
| LOW | loguru/_file_sink.py | 165 | CODE | |
| LOW | loguru/_logger.py | 273 | CODE | |
| LOW | loguru/_logger.py | 1384 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | docs/conf.py | 81 | # The theme to use for HTML and HTML Help pages. See the documentation for | COMMENT |
| LOW | docs/conf.py | 101 | # defined by theme itself. Builtin themes are using these templates by | COMMENT |
| LOW | docs/conf.py | 121 | # | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | loguru/_logger.py | 782 | Windows, don't forget to restart your terminal for the change to be taken into account. | CODE |
| LOW | loguru/_logger.py | 1737 | >>> logger.info("While publishing a library, don't forget to disable logging") | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_template_strings.py | 18 | # We can't just use t"2**8 = {2**8}", because its a syntax error before python-3.14. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | loguru/__init__.py | 16 | __all__ = ["logger"] | CODE |