Skip to content

Best way to trace from inside other classes and static methods #14

@trondhindenes

Description

@trondhindenes

This may be a bit too generic question, but I'm attempting it anyway:

It would be awesome if the there was examples of a more "real-life" flask app. As a rule we split up the app into multiple classes (one class per route), and also move "helpers" into separate class functions (static or not).

It's not completely clear to me how I would go about maintining a reference to the instantiated FlaskTracer object (called tracer in the examples).

  • For route classes we usually "cheat" by importing them after the app object is instantiated, so those can reference the FlaskTracer by importing it from the app class
  • However, for helpers these are usually imported before the app object is instantiated (as a normal import).

I guess I'm looking for best-practices in how to deal the FlaskTracer throughout my app. Some more advanced examples would be awesome.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions