Three important things to know about this package :
We will be following the CPE-NBC framework to log information.
C - Customer ID - To know which customer is using your product
P - Product ID- To know which product is being used
N - Node ID - To know which node of your product your customer is interacting with? (Front-End, Back-End, Analytics, etc.)
B - Branch ID - To know which branch or version of your product your customer is interacting with?
E - Endpoint - Identifies which features in your product your customers interact with (identifies customer-feature fit)
C - Code ID - To know which code blocks are being run when your customer interacts with your endpoint.
We would be auto-calculating execution time taken by the code block to analyze product performance. If you have information about code cost (For APIs, Queries, etc.), you can add this information while logging to analyze product cost performance.
This style of logging makes data relational (every log is related to each other) and provides a complete understanding of your business.
We use function wrappers instead of traditional logging. This makes logging simple and beautiful (really).
Function wrappers start with an @ symbol. For example,
@insightsoncode_logger(log_1, log_2)
def your_product_function():
<your code>
You can log values that simply.
We have three types of loggers - constants logger, endpoint logger and code logger.
Constant loggers @log_constantpoints()
This logs information that will remain constant throughout your code. As the information is constant, they just have to be logged once.
Constant logs include product, node and branch IDs; as each product-node-branch combination define an independent module of your software and are constant within this module.
Endpoint logger @log_endpoint()
This logs the features users interact with (in tech jargon - an endpoint), and is unique for each endpoint at a module level.
Code logger @log_codepoint()
This logs code blocks- which could be any function (block of code) including API calls, Query calls, etc.
Note that we have missed one logging information - Customer ID - as we can gain this information only when running the code and not when writing code.
Customer ID is thus logged separately when a customer interacts with the endpoint (during code run).
Email: insightsoncode@gmail.com