View Javadoc

1   // Copyright 2006-2007, by the California Institute of Technology.
2   // ALL RIGHTS RESERVED. United States Government Sponsorship acknowledged.
3   // Any commercial use must be negotiated with the Office of Technology Transfer
4   // at the California Institute of Technology.
5   //
6   // This software is subject to U. S. export control laws and regulations
7   // (22 C.F.R. 120-130 and 15 C.F.R. 730-774). To the extent that the software
8   // is subject to U.S. export control laws and regulations, the recipient has
9   // the responsibility to obtain export licenses or other export authority as
10  // may be required before exporting such information to foreign countries or
11  // providing access to foreign nationals.
12  //
13  // $Id$ 
14  //
15  
16  package gov.nasa.pds.tools.logging;
17  
18  import java.util.logging.Level;
19  import java.util.logging.LogRecord;
20  
21  /***
22   * @author pramirez
23   * @version $Revision$
24   * 
25   */
26  public class ToolsLogRecord extends LogRecord {
27      private String file;
28      private String context;
29      private int line;
30  
31      public ToolsLogRecord(Level level, String message) {
32          this(level, message, null, null);
33      }
34      
35      /***
36       * Constructs a log record 
37       * @param level of error
38       * @param message describing error
39       * @param file in which error occured
40       */
41      public ToolsLogRecord(Level level, String message, String file) {
42          this(level, message, file, null);
43      }
44      
45      /***
46       * Construct a log record 
47       * @param level of error
48       * @param message describing error
49       * @param file in which error occured
50       * @param line number at which occured
51       */
52      public ToolsLogRecord(Level level, String message, String file, int line) {
53          this(level, message, file, null, line);
54      }
55      
56      /***
57       * Construct a log record 
58       * @param level of error
59       * @param message describing error
60       * @param file in which error occured
61       * @param context file which referenced file where error occured
62       */
63      public ToolsLogRecord(Level level, String message, String file, String context) {
64          this(level, message, file, context, -1);
65      }
66      
67      /***
68       * Construct a log record
69       * @param level of error
70       * @param message describing error
71       * @param file in which error occured
72       * @param context file which referenced file where error occured
73       * @param line number at which occured
74       */
75      public ToolsLogRecord(Level level, String message, String file, String context, int line) {
76          super(level, message);
77          this.file = file;
78          this.context = context;
79          this.line = line;
80      }
81  
82      public String getFile() {return file;}
83      
84      public String getContext() {return context;}
85      
86      public int getLine() {return line;}
87   
88  }