)]}'
{"rally/common/logging.py":[{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"16b9e1f05ab26eb5a7210e07fc73bc2f35f4f979","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        :return: a tuple where the first element is a filename, the second is"},{"line_number":76,"context_line":"            a line number and the third is a line of code"},{"line_number":77,"context_line":"        \"\"\""},{"line_number":78,"context_line":"        import inspect"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"        # the first 2 elements in the stack are the current line and the line"},{"line_number":81,"context_line":"        #   of caller of `_find_the_caller`"}],"source_content_type":"text/x-python","patch_set":2,"id":"7f515b1d_e74fe367","line":78,"updated":"2017-10-06 21:57:21.000000000","message":"Why not just using \n\n(traceback.extract_stack()[-2])\n\ninstead of inspect?","commit_id":"57a2e083103c39d91ff3b6c114fbdcfc7b7ac91c"},{"author":{"_account_id":9545,"name":"Andriy Kurilin","email":"andr.kurilin@gmail.com","username":"akurilin"},"change_message_id":"2a0c1181d12b69a2b82e9d7241b9639c796bd774","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        :return: a tuple where the first element is a filename, the second is"},{"line_number":76,"context_line":"            a line number and the third is a line of code"},{"line_number":77,"context_line":"        \"\"\""},{"line_number":78,"context_line":"        import inspect"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"        # the first 2 elements in the stack are the current line and the line"},{"line_number":81,"context_line":"        #   of caller of `_find_the_caller`"}],"source_content_type":"text/x-python","patch_set":2,"id":"7f515b1d_472eb7a5","line":78,"in_reply_to":"7f515b1d_e74fe367","updated":"2017-10-06 22:38:58.000000000","message":"1) I see no difference between using traceback lib and inspect in terms of performance\n\n2) Traceback is not \"user-friendly\" for current case\n2.1) traceback.extract_stack() returns a list of objects (traceback.FrameSummary) which are not so obvious like NameTuples from inspect.stack() . So some research and transformation are required (inspect did it for us)\n2.2) traceback can return a trace in format of a list of strings. BUT it is designed to be printed without modifications(the while list). To obtain the same information as inspect.stack[i] returns, we need to take one string from the trace-list. It will be an actual code-line which executes the logging in a wrong way. Such info is not enough for identification the line to fix, so we need to continue iterating over the list. The next string can be a name of a method where the code is executed (method foo can exist in different places, so iteration should continue) or the name o module(what we need). In other words, using traceback requires much more code and complicated logic.","commit_id":"57a2e083103c39d91ff3b6c114fbdcfc7b7ac91c"}]}
