Skip to content

Release 2.0.0

Compare
Choose a tag to compare
@mhucka mhucka released this 12 Jul 19:59
· 8 commits to main since this release

This introduces backwards-incompatible changes to the API, and adds one new function.

In recognition that modern Python code more often uses f-strings, the function logr is now named log, and what was previously log is now called logf. Users who called the log function with single strings will not notice any difference; users who called it with more than one argument (a string and format arguments) will get an error; and users who called logr will also get an error, about an undefined function. The new set of log functions is more logically organized:

  • log takes a single argument, a string. It does not apply format to the string.
  • loglist is like log, except it accepts multiple strings. It prints them one line at time.
  • logf takes a single string as the first argument and optionally multiple arguments after that. It passes the optional arguments to format.

An advantage of the new scheme is that it is more obvious when a message string will be passed to format. Previously, if a string contained a character that had special meaning to format (particularly {) was passed to log, it would result in an unexpected error. Now, the requirement to use the variant logf hopefully makes it more obvious that the arguments are being treated specially.