# Not getting python logger output in Travis logs

**URL:** <https://travis-ci.community/t/not-getting-python-logger-output-in-travis-logs/12745>\
**Category:** Python\
**Created:** [March 3, 2022, 4:47pm UTC](https://travis-ci.community/t/not-getting-python-logger-output-in-travis-logs/12745 "2022-03-03T16:47:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rpgoldman](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/rpgoldman/32/7725_2.png) [@rpgoldman](https://travis-ci.community/u/rpgoldman)\
**Post date:** [March 3, 2022, 4:47pm UTC](https://travis-ci.community/t/not-getting-python-logger-output-in-travis-logs/12745/1 "2022-03-03T16:47:00Z")

</div>

I am running the Travis script here: [pyDcop/.travis.yml at master · rpgoldman/pyDcop · GitHub](https://github.com/rpgoldman/pyDcop/blob/master/.travis.yml)

I am trying to debug a problem which is that the tests all pass in Travis, but not locally (I know! The reverse of the usual problem.)

So what I tried to do was to turn on python logging in a particular test, in order to compare input to a function that breaks locally, but works remotely (see [test source](https://github.com/rpgoldman/pyDcop/blob/2a57ab4fe1fb857b22f72469e9cc77ee2b982d4d/tests/api/test_api_distribute_ilp_fgdp.py#L72-L90)):

```auto
def test_api_distribute_dsa_ilp_fgdp():
    import logging
    logger = logging.getLogger('distribution.ilpfgdp')
    logger.setLevel(logging.DEBUG)

    from pydcop.computations_graph import factor_graph
    from pydcop.distribution import ilp_fgdp
    from pydcop.algorithms import dsa

    dcop = dcop_graphcoloring_3()
    agents = create_agents('a', range(1, 4), capacity=100)
    dcop._agents_def = agents

    cg = factor_graph.build_computation_graph(dcop)
    dist = ilp_fgdp.distribute(cg, dcop.agents.values(),
                               computation_memory=dsa.computation_memory,
                               communication_load=dsa.communication_load)

    assert dist.is_hosted(['v1', 'v2', 'v3'])

```

When I run this locally, I see near the bottom of `pytest` output:

```auto
---------------------------------------------------------- Captured log call -----------------------------------------------------------
ilp_fgdp.py 97 DEBUG Must host: defaultdict(<function distribute.<locals>.<lambda> at 0x1051f4b80>, {'a1': ['v1', 'v2', 'v3', 'cost_1', 'cost_2', 'cost_3', 'c1', 'c2'], 'a2': ['v1', 'v2', 'v3', 'cost_1', 'cost_2', 'cost_3', 'c1', 'c2'], 'a3': ['v1', 'v2', 'v3', 'cost_1', 'cost_2', 'cost_3', 'c1', 'c2']})

```

But when I look at [the logs on travis](https://app.travis-ci.com/github/rpgoldman/pyDcop/builds/247357785), there’s no transcript of captured log calls.

Is there some way to get this information into the travis logs?

Unfortunately, when I do this, and look at the travis log files, there is no output from `pytest`. Does travis do something to swallow the output of the python logger
