1. A method for diagnosing an error associated with a software, the method comprising: receiving a stack trace associated with the error; fetching a source code associated with the received stack trace; parsing the fetched source code associated with the received stack trace; generating an abstract syntax tree (AST) based on the parsed fetched source code; inserting at least one logging call into the generated abstract tree; and recompiling the fetched source code based on the generated abstract tree with the at least one inserted logging call.