Method, system, and program for logging statements to monitor execution of a program
First Claim
1. A method for generating trace statements to a log file, comprising:
- processing a log method in a program including an identifier parameter, wherein the program includes multiple instances of the log method to trace the execution of the program during debugging operations;
determining whether a variable indicates that log methods called with the identifier parameter should be processed;
determining a class and method from which the log method was called if the variable indicates that log methods called with the identifier parameter should be processed; and
writing trace statements including information on the identifier parameter and determined class and method to the log file.
1 Assignment
0 Petitions
Accused Products
Abstract
Disclosed is a system, method, and program for generating trace statements to a log file. A log method in a program, such as a Java program, including an identifier parameter is processed. The program includes multiple instances of the log method to trace the execution of the program during debugging operations. A determination is made as to whether a variable indicates that log methods called with the identifier parameter should be processed. The class and method from which the log method was called is determined if the variable indicates that log methods called with the identifier parameter should be processed. Information on the identifier parameter and determined class and method are written to the log file.
-
Citations
30 Claims
-
1. A method for generating trace statements to a log file, comprising:
-
processing a log method in a program including an identifier parameter, wherein the program includes multiple instances of the log method to trace the execution of the program during debugging operations;
determining whether a variable indicates that log methods called with the identifier parameter should be processed;
determining a class and method from which the log method was called if the variable indicates that log methods called with the identifier parameter should be processed; and
writing trace statements including information on the identifier parameter and determined class and method to the log file. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10)
processing group numbers packed by a power of two into a string to determine whether a group number associated with the identifier parameter is included in the string, wherein the log methods called with the identifier parameter are only processed if the group number associated with the identifier parameter is included in the string.
-
-
5. The method of claim 1, wherein determining the class and method further comprises:
-
determining a thread ID on which the log method was called; and
using the thread ID to determine the class and method from which the log method was called.
-
-
6. The method of claim 1, further comprising:
-
writing the trace statements to a buffer; and
periodically writing the trace statements from the buffer to the log file.
-
-
7. The method of claim 1, wherein the log method is processed by a thread executing the program and wherein the thread determines whether the variable indicates that the processed log method should be processed and the class and method from which the log method was called.
-
8. The method of claim 7, wherein the thread executing the program is executing in a first process, wherein the thread calls a second process separate from the first process, wherein the second process performs:
-
writing the trace statements to a buffer; and
periodically writing the trace statements from the buffer to the log file.
-
-
9. The method of claim 7, wherein a first process in which the program is executed is capable of simultaneously processing multiple log methods called from multiple threads executing in the first process, wherein each thread in the first process is capable of separately determining the class and method for each of the multiple log methods that are processed.
-
10. The method of claim 1, wherein the program is object code generated from a Java source program.
-
11. A system for generating trace statements to a log file, comprising:
-
means for processing a log method in a program including an identifier parameter, wherein the program includes multiple instances of the log method to trace the execution of the program during debugging operations;
means for determining whether a variable indicates that log methods called with the identifier parameter should be processed;
means for determining a class and method from which the log method was called if the variable indicates that log methods called with the identifier parameter should be processed; and
means for writing trace statements including information on the identifier parameter and determined class and method to the log file. - View Dependent Claims (12, 13, 14, 15, 16, 17, 18, 19, 20)
means for processing group numbers packed by a power of two into a string to determine whether a group number associated with the identifier parameter is included in the string, wherein the log methods called with the identifier parameter are only processed if the group number associated with the identifier parameter is included in the string.
-
-
15. The system of claim 11, wherein the means for determining the class and method further comprises:
-
means for determining a thread ID on which the log method was called; and
means for using the thread ID to determine the class and method from which the log method was called.
-
-
16. The system of claim 11, further comprising:
-
means for writing the trace statements to a buffer; and
means for periodically writing the trace statements from the buffer to the log file.
-
-
17. The system of claim 11, wherein the log method is processed by a thread executing the program and wherein the thread comprises the means for determining whether the variable indicates that the processed log method should be processed and the class and method from which the log method was called.
-
18. The system of claim 17, wherein the thread executing the program is executing in a first process, wherein the thread calls a second process separate from the first process, wherein the second process includes:
-
means for writing the trace statements to a buffer; and
means for periodically writing the trace statements from the buffer to the log file.
-
-
19. The system of claim 17, wherein a first process in which the program is executed is capable of simultaneously processing multiple log methods called from multiple threads executing in the first process, wherein each thread in the first process is capable of separately determining the class and method for each of the multiple log methods that are processed.
-
20. The system of claim 11, wherein the program is object code generated from a Java source program.
-
21. An article of manufacture for generating trace statements to a log file, wherein computer usable media includes at least one computer program that is capable of causing the computer system to perform:
-
processing a log method in a program including an identifier parameter, wherein the program includes multiple instances of the log method to trace the execution of the program during debugging operations;
determining whether a variable indicates that log methods called with the identifier parameter should be processed;
determining a class and method from which the log method was called if the variable indicates that log methods called with the identifier parameter should be processed; and
writing trace statements including information on the identifier parameter and determined class and method to the log file. - View Dependent Claims (22, 23, 24, 25, 26, 27, 28, 29, 30)
processing group numbers packed by a power of two into a string to determine whether a group number associated with the identifier parameter is included in the string, wherein the log methods called with the identifier parameter are only processed if the group number associated with the identifier parameter is included in the string.
-
-
25. The article of manufacture of claim 21, wherein determining the class and method further comprises:
-
determining a thread ID on which the log method was called; and
using the thread ID to determine the class and method from which the log method was called.
-
-
26. The article of manufacture of claim 21, further comprising:
-
writing the trace statements to a buffer; and
periodically writing the trace statements from the buffer to the log file.
-
-
27. The article of manufacture of claim 21, wherein the log method is processed by a thread executing the program and wherein the thread determines whether the variable indicates that the processed log method should be processed and the class and method from which the log method was called.
-
28. The article of manufacture of claim 27, wherein the thread executing the program is executing in a first process, wherein the thread calls a second process separate from the first process, wherein the second process performs:
-
writing the trace statements to a buffer; and
periodically writing the trace statements from the buffer to the log file.
-
-
29. The article of manufacture of claim 27, wherein a first process in which the program is executed is capable of simultaneously processing multiple log methods called from multiple threads executing in the first process, wherein each thread in the first process is capable of separately determining the class and method for each of the multiple log methods that are processed.
-
30. The article of manufacture of claim 21, wherein the program is object code generated from a Java source program.
Specification