Skip to content

File Logging #9

@maxholloway

Description

@maxholloway

File Logging

Interface-changing Proposal

Add an option to StrategyOptions to which logs should be written.

Motivation

If we do anything more complicated than running from command-line, the console printing doesn't make much sense. Also, there is a performance hit when we run make calls to the console, whereas writing logs to a file is much less expensive.

Implementation

  1. Add option to StrategyOptions called logfilepath.
  2. Add an if-else block to log that will decide how to output the statement, given the attribute in strat.options.logfilepath, then perform the desired output action.

Side thoughts

It will be worthwhile to check how costly this operation is in practice. If it severely slows down the backtest, we can add logic to batch-write the logging messages (either when the backlog gets to a certain size, or when the backtest is finished running). 😸

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgood first issueGood for newcomersp4Low Priority (priority 4)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions