Skip to content

Re-classify unnecessary ldata logging as DEBUG #526

Open

Description

@skovaka

When using the python logging module, operations like downloading remote files or LPath.iterdir() generates a bunch of logging.INFO messages containing long dictionaries like this:

2025-02-24 16:40:42 - INFO - >>> {"query": "query LDataChildren($argPath: String!) {\n  ldataResolvePathData(argPath: $argPath) {\n    finalLinkTarget {\n      type\n      childLdataTreeEdges(filter: {child: {removed: {equalTo: false}}}) {\n        nodes {\n          child {\n            name\n          }\n        }\n      }\n    }\n  }\n}", "variables": {"argPath": "..."}}
2025-02-24 16:40:42 - INFO - <<< {"data":{"ldataResolvePathData":{"finalLinkTarget":{"type":"DIR","childLdataTreeEdges":{"nodes":[{"child":{"name":"..."}},{"child":{"name":"..."}},{"child":{"name":"..."}},{"child":{"name":"..."}},{"child":{"name":"..."}},{"child":{"name":"..."}},{"child":{"name":"..."}},{"child":{"name":"..."}},{"child":{"name":"..."}}]}}}}}

Performing many filesystem operations really fills up the workflow log and makes it hard to read. It seems like the level of these messages should be set to logging.DEBUG instead of logging.INFO? Thanks!

Activity

  1. added
    enhancement
    on Feb 24, 2025
  2. asharaali commented on Sep 9, 2026

    @asharaali

    These lines aren't coming from latch. LPath.iterdir() calls query_with_retry
    (src/latch/ldata/_transfer/utils.py:26) → latch_sdk_gql.execute.execute, which
    builds gql.Client(transport=RequestsHTTPTransport(...)). In gql 3.5.0,
    gql/transport/requests.py:227 logs the request as log.info(">>> %s", ...) and
    :263 the response as log.info("<<< %s", ...) — the >>>/<<< prefixes above.

    Upstream already changed it: graphql-python/gql#552, "Set logging level to DEBUG
    for all transports", merged 2025-05-25. That landed after v3.5.3, so the first
    release carrying it is v4.0.0. pyproject.toml:38 pins gql==3.5.0, which is
    why it still shows up.

    That leaves either bumping to gql 4.x — which also pulls in the transport
    refactor from #557 — or having latch set the level on gql.transport.requests
    itself, which changes logging config for anything else importing latch. Both look
    like calls for you rather than me. Happy to send a patch for whichever you'd
    prefer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions