Setup (post installation of python package)
In your main python file where the endpoints are defined, import Constant logger and Code logger.
from insightsoncode.wrappers import log_constantpoints, log_codepoint
Define the values for the constant logs by calling the Constants logger function.
log_constantpoints(project_id = "1", branch_id = "main_1", csv_filename ="ioc_business_logs.csv")
The results from the previous step will return a function. Save this function as Endpoint logger.
log_endpoint = log_constantpoints(....)
Write the below line of code. Note that there are No paranthesis at the end of the code. That is we are just re-defining the function, not calling it.
log_codepoint = log_codepoint
The setup is now complete.
Step 4 is required to maintain a single source of truth for Endpoint and Code loggers. This will help in tracking log information across python files.
Therefore, please note that when using Endpoint logger and Code logger in any other file, import them from the main python file.
from main_python_file import log_endpoint, log_codepoint
Email: insightsoncode@gmail.com