Skip to content
Kepoor Hampond edited this page Mar 26, 2017 · 7 revisions

Basic Rundown

import draftlog: What actually imports the module.

draft = draftlog.inject(): What injects the line counter into the stdout stream. The rest of the docs will refer to draft as in the function draftlog.inject()

draft.log(text="\n"): Returns a LogDraft object that is responsible for updating itself. text can be a normal string that will always have \n appended to it.

  • update(text): Update the line with some new text. It's recommended that there are no \n (newline characters) in the string.
  • set_interval(function, time, loader=False, update=True: Adds an interval into a background thread process. It's meant to mimic nodejs's setInterval function. The intervals can be started with draft.start(). If loader is set equal to True, then the exit of the intervals will not depend on it. If update is set to False, then each new update will be set on a new line. See the examples folder for some examples.
Clone this wiki locally