This document collects the full What's New sections of all log_calls
releases.
time
module (see PEP 418; also see the Python 3 docs for the new functions perf_counter
and process_time
), and we take advantage of the new functionaility when it's available. (Under Py < 3.3 log_calls
reports elapsed and CPU times as the same number, so as not to further complicate user experience, docs and tests with special appearance and behavior for older Python versions.)
time.perf_counter
, time.process_time
if available (Python 3.3+), otherwise use time.time
as in earlier versions.stats.CPU_secs_logged
attribute.CPU_secs
column to call history (new field for CallRecord
s).log_elapsed
reports both elapsed and CPU times.enabled
< 0, adjourn to the decorated function immedately, with no further processing. Again, not a speed speed demon – see the IPython notebook referenced above.settings_path
parameter used. (You'll see this only if you run the Python interpreter with the -W <action>
option, where <action>
is any valid action string other than ignore
, e.g. default
.)0.2.4.post2
settings
parameter (formerly settings_path
) lets you specify default values for multiple settings either as a dictionary, or as a file. The settings_path
parameter is deprecated, as settings
is a superset. See the documentation here for details, discussion and examples.0.2.4.post1
settings_path
feature: allow file=sys.stderr
in settings files, under IPython too; neater internals of settings file parsing.0.2.4
settings_path
parameter lets you specify a file containing default values for multiple settings. See the documentation here for details, discussion and examples.logging.getLogger()
) as the value of the logger
setting.indent
setting now works with loggers too. See examples:
log_message
as a general output function that works as expected, whatever the destination – stdout
, another stream, a file, or a logger [in tests/test_log_calls_more.py
, docstring of main__log_message__all_possible_output_destinations()
];print
[in tests/test_log_calls_more.py
, docstring of main__logging_with_indent__minimal_formatters()
].used_unused_keywords
to support the settings_path
feature, and made it visible (you can import it from the package) because it's more broadly useful. This decorator lets a function obtain, on a per-call basis, two dictionaries of its explicit keyword arguments and their values: those which were actually passed by the caller, and those which were not and received default values. For examples, see the docstring of main()
in used_unused_kwds.py
.log_retval
setting is true), the maximum displayed length of values is now 77, up from 60, not counting trailing ellipsis.indent_extra
parameter to log_message
is gone.0.2.3 and 0.2.3.post N
log_message()
, and more, better examples of it — full docs here.0.2.2
log_message()
, which decorated functions and methods can use to write extra debugging messages that align nicely with log_calls
messages.log_message()
.log_calls
adds for them, within their own bodies.stats.history_as_DataFrame
attribute, whose value is the call history of a decorated function as a Pandas DataFrame (if Pandas is installed; else None
).log_calls/docs/history_to_pandas.ipynb
, browsable as HTML here) which compares the performance of using record_history
vs a vectorized approach using numpy to amass medium to large datasets, and which concludes that if you can vectorize, by all means do so.