backtrader.bokeh.tabs.log module

Log tab.

Displays strategy execution logs.

class backtrader.bokeh.tabs.log.LogHandler[源代码]

基类:Handler

Log handler.

Captures log messages and stores them in specified storage.

__init__(storage_key, max_records=1000)[源代码]

Initialize log handler.

参数:
  • storage_key -- Key to identify log storage in global dictionary.

  • max_records -- Maximum number of log records to keep (default: 1000).

emit(record)[源代码]

Emit a log record.

参数:

record -- Log record to process.

backtrader.bokeh.tabs.log.getlogger(name='backtrader', col=None)[源代码]

Get logger with log handler.

参数:
  • name -- Logger name

  • col -- Custom columns (optional)

返回:

logging.Logger instance

class backtrader.bokeh.tabs.log.LogTab[源代码]

基类:BokehTab

Log tab.

Displays log information during strategy execution.

cols

Column configuration for display

__init__(app, figurepage, client=None, cols=None)[源代码]

Initialize log tab.

参数:
  • app -- Bokeh application instance.

  • figurepage -- Figure page instance.

  • client -- Optional client instance.

  • cols -- Custom column configuration for log display.

cols = ['Time', 'Level', 'Message']
backtrader.bokeh.tabs.log.LogTabs(cols)[源代码]

Create log tab class with custom columns.

参数:

cols -- Column configuration

返回:

Custom LogTab class