scistag.vislog.visual_log_mock.VisualMicroLock

class VisualMicroLock(log_to_std_out=True)[source]

Bases: object

VisualMicroLock is a replacement for the VisualLogBuilder class of the SciStag Python package to easily port an application using VirtualLog for logging to platforms which are not capable of loading of the full SciStag library such as MicroPython.

Tries to wrap all common commands to a simple log to stdout operation as good as possible.

Parameters

log_to_std_out – Defines if all simple logging shall be directed to stdout.

Methods

br

Inserts a simple line break

critical

Logs a critical error

debug

Logs an info text

error

Logs an info text

figure

rtype

VisualMicroLock

finalize

Finalizes the log

image

rtype

VisualMicroLock

info

Logs an info text

log_text

Logs text to stdout

page_break

Inserts a page break

setup_micro_lock

Stores the VisualMicroLock class in the defined directory so it can easily be imported.

table

Adds a table to the log.

text

Replacement for VisualLogBuilder.text() and all similar functions.

warning

Logs an info text

Attributes

__dict__

__doc__

__module__

__weakref__

list of weak references to the object (if defined)

is_micro

Returns if this builder is a log with limited functionality for MicroPython.

title

Replacement for VisualLogBuilder.title()

sub

Replacement for VisualLogBuilder.sub()

sub_x3

Replacement for VisualLogBuilder.sub_x3()

sub_x4

Replacement for VisualLogBuilder.sub_x4()

sub_test

Replacement for VisualLogBuilder.sbu_test()

md

Replacement for VisualLogBuilder.md()

html

Replacement for VisualLogBuilder.html()

log_to_stdout

Defines if the simple output shall be directed to stdout

br()[source]

Inserts a simple line break

critical(*args, **_)[source]

Logs a critical error

Parameters

args – The elements to log. Will be separated by space.

Return type

VisualMicroLock

debug(*args, **_)[source]

Logs an info text

Parameters

args – The elements to log. Will be separated by space.

Return type

VisualMicroLock

error(*args, **_)[source]

Logs an info text

Parameters

args – The elements to log. Will be separated by space.

Return type

VisualMicroLock

finalize(*_, **__)[source]

Finalizes the log

info(*args, **_)[source]

Logs an info text

Parameters

args – The elements to log. Will be separated by space.

Return type

VisualMicroLock

log_text(*args, **_)[source]

Logs text to stdout

Parameters

args – The elements to log. Will be separated by space.

Return type

VisualMicroLock

page_break()[source]

Inserts a page break

static setup_micro_lock(target_path='./')[source]

Stores the VisualMicroLock class in the defined directory so it can easily be imported. Call this once in a new project.

Parameters

target_path (str) – The path at which the Python files shall be stored.

table(data, *_, **__)[source]

Adds a table to the log.

Parameters
  • data – A list of rows of which each row contains the same count of columns. The content has to be convertible to a string.

  • _

  • __

Return type

VisualMicroLock

Returns

text(text, *args, **kwargs)[source]

Replacement for VisualLogBuilder.text() and all similar functions. Suppresses all parameters except the text.

Parameters

text (str) – The text to be logged

Returns

self

warning(*args, **_)[source]

Logs an info text

Parameters

args – The elements to log. Will be separated by space.

Return type

VisualMicroLock

html

Replacement for VisualLogBuilder.html()

property is_micro: bool

Returns if this builder is a log with limited functionality for MicroPython.

Return type

bool

Returns

True if it is a minimalistic lock

log_to_stdout

Defines if the simple output shall be directed to stdout

md

Replacement for VisualLogBuilder.md()

sub

Replacement for VisualLogBuilder.sub()

sub_test

Replacement for VisualLogBuilder.sbu_test()

sub_x3

Replacement for VisualLogBuilder.sub_x3()

sub_x4

Replacement for VisualLogBuilder.sub_x4()

title

Replacement for VisualLogBuilder.title()