log_every_n#

scikitplot.logging.log_every_n(level, msg, n, *args, **kwargs)[source]#

Log once per n calls from the same call site.

Log ‘msg % args’ at level ‘level’ once per ‘n’ times.

Logs the 1st call, (N+1)st call, (2N+1)st call, etc. Not threadsafe.

Parameters:
levelint or str

Logging level.

msgstr

Message template.

nint

Log period. Must be >= 1.

*argsAny

Message formatting args.

**kwargsAny

Passed to the underlying logger.

Raises:
ValueError

If n < 1.

Parameters:
  • level (int | str)

  • msg (str)

  • n (int)

  • args (any)

  • kwargs (any)

Return type:

None