[issue30995] Support logging.getLogger(style='{')

2017-09-25 Thread Vinay Sajip
Changes by Vinay Sajip : -- resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker ___

[issue30995] Support logging.getLogger(style='{')

2017-09-24 Thread Raymond Hettinger
Raymond Hettinger added the comment: > logger.info( f" {logger.name:s} {logger.module:s} " ) > > this could be supported with full backward compatibility > with very little effort. > > Am I missing something? One issue is that some of that data isn't known until the logging.info() call is

[issue30995] Support logging.getLogger(style='{')

2017-09-24 Thread Steven Warwick
Steven Warwick added the comment: sorry, I meant the following: logger.info( " {:s} {:s} ".format(logger.name, logger.module ) ) or logger.info( f" {logger.name:s} {logger.module:s} " ) this could be supported with full backward compatibility with very little effort. Am I missing

[issue30995] Support logging.getLogger(style='{')

2017-09-24 Thread Raymond Hettinger
Raymond Hettinger added the comment: [Vinay Sajip] > I don't think the ways of doing this are bulletproof and > require too much cooperation between third-party libraries. I concur with all of Vinay's comments. If logging were being redesigned from scratch, it would likely use new-style

[issue30995] Support logging.getLogger(style='{')

2017-09-24 Thread Steven Warwick
Steven Warwick added the comment: you probably have already considered this, but I just wanted to ask if it might be worth considering turning the problem "upside down" to make things easier. I'm interpreting the problem that there are variables we'd like to add to the output log that are

[issue30995] Support logging.getLogger(style='{')

2017-07-28 Thread Vinay Sajip
Vinay Sajip added the comment: > Which third-party libraries? > It is my code in my file. If a feature is added to logging, anyone can use it. If people put style-specific loggers in libraries they write, and other people then use those libraries, then there may be a need for them to worry

[issue30995] Support logging.getLogger(style='{')

2017-07-27 Thread Mitar
Mitar added the comment: > That's the problem, right there. I don't think the ways of doing this are > bulletproof and require too much cooperation between third-party libraries. Which third-party libraries? The thing I am proposing works for that particular file you call getLogger with. In

[issue30995] Support logging.getLogger(style='{')

2017-07-27 Thread Vinay Sajip
Vinay Sajip added the comment: > You only have to make sure they do not use this logger without knowing about > new format, which can be done in various ways (like prefixing the name of the > logger, for example). That's the problem, right there. I don't think the ways of doing this are

[issue30995] Support logging.getLogger(style='{')

2017-07-23 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +vinay.sajip ___ Python tracker ___ ___ Python-bugs-list

[issue30995] Support logging.getLogger(style='{')

2017-07-22 Thread Mitar
New submission from Mitar: Currently, using non-legacy formatting in logging message is really cumbersome. I think a new style could be supported much easier using the following: logger = logging.getLogger(style='{') logger.misc('User {} logged in', username} This is both backwards