Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: string Multiline Formatter #88885

Closed
creative-resort mannequin opened this issue Jul 23, 2021 · 5 comments
Closed

RFC: string Multiline Formatter #88885

creative-resort mannequin opened this issue Jul 23, 2021 · 5 comments
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@creative-resort
Copy link
Mannequin

creative-resort mannequin commented Jul 23, 2021

BPO 44722
Nosy @terryjreedy, @ericvsmith, @creative-resort
PRs
  • bpo-44722: Added a Multiline Formatter #27301
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2021-07-24.01:18:24.674>
    created_at = <Date 2021-07-23.08:35:04.722>
    labels = ['type-feature', 'library']
    title = 'RFC: string Multiline Formatter'
    updated_at = <Date 2021-07-24.01:18:24.674>
    user = 'https://github.com/creative-resort'

    bugs.python.org fields:

    activity = <Date 2021-07-24.01:18:24.674>
    actor = 'creative-resort'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-07-24.01:18:24.674>
    closer = 'creative-resort'
    components = ['Library (Lib)']
    creation = <Date 2021-07-23.08:35:04.722>
    creator = 'creative-resort'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 44722
    keywords = ['patch']
    message_count = 5.0
    messages = ['398034', '398039', '398043', '398099', '398111']
    nosy_count = 3.0
    nosy_names = ['terry.reedy', 'eric.smith', 'creative-resort']
    pr_nums = ['27301']
    priority = 'normal'
    resolution = None
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue44722'
    versions = []

    @creative-resort
    Copy link
    Mannequin Author

    creative-resort mannequin commented Jul 23, 2021

    I'm opening this issue to propose the following enhancement
    and a PR on GitHub.

    Concerning: https://github.com/python/cpython/blob/main/Lib/string.py

    The idea:
    Format strings, that are comprised of field values with newlines (Multiline)
    as Multiline strings in a quasi tabbed format.

    --> In particular useful for logging of information, that occupies multiple lines.

    For example: '{levelname}:{name}:{message}:{api}',
    where the message and the api field is a string with multiple lines (contains newlines)

    The result: 2021-07-23 09:50:28,981 module_name WARNING Quota exceeded Google-Cloud-API
    Backing off for 5s version: v1
    after trying 2x

    @creative-resort creative-resort mannequin added stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Jul 23, 2021
    @ericvsmith
    Copy link
    Member

    Can you provide a specification of what this class does? You’ve given an example, but not a description of the behavior.

    @creative-resort
    Copy link
    Mannequin Author

    creative-resort mannequin commented Jul 23, 2021

    Thank you.

    In the process of providing that description I also just realized – after also seeing the build fail – that I'm making use of a library which is not part of the core (llist) for a doubly linked list.

    That dependency is most probably a deal breaker and would require refactoring.

    @terryjreedy
    Copy link
    Member

    I suggest you close this issue and if you have an improved code, propose it on python-ideas list for discussion.

    @creative-resort
    Copy link
    Mannequin Author

    creative-resort mannequin commented Jul 24, 2021

    Thank you for your kind guidance :)

    @creative-resort creative-resort mannequin closed this as completed Jul 24, 2021
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants