Abstract:
Due to the lack of a rigorous specification to guide logging behaviors, choosing the correct level for log statements is a challenge. Prior studies on log level suggestion ignore the relationship between statements and fail to provide suggestions for logging statements at any specific positions. Based on this, L3R, a GNN-based log level suggest method, is proposed. The method took statement features as nodes, control flow and data flow edges as edges to construct a context graph, updated the logging statement feature based on the relational graph attention network and implemented the log level prediction. Evaluations were conducted on 7 open-source projects, which verified the effectiveness of the method.