Skip to content

Multi-line messages shouldn't be trimmed or split #15

@PFython

Description

@PFython

I noticed that

a) leading tabs \t are removed from multi-line messages (and possibly single line - not tested)
b) multi-line messages are split by new line \n but I think the results should be one item in the results list per message, not per line. In other words the text string of each log message should not be altered by the .find method. If people want to strip out whitespace after receiving the original string then that's up to them, but I think we need to give them the option because sometimes the newline formatting will be important.

Here's the test I think we need to pass, which I've added to test_log2d.py:

@create_mylog
def test_find_multiline():
    Log.mylog.info("Three line message\n\twith more data on this line\n\t\tand also on this line too!")
    r = mylog.find()
    assert len(r) == 2
    assert r.count("\t") == 3
    assert r.count("\n") == 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions