1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 __authors__ = ["Olof Svensson", "Jerome Kieffer"]
34 __contact__ = "svensson@esrf.fr"
35 __license__ = "LGPLv3+"
36 __copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
37
38
39 from EDLogging import EDLogging
40
41
43 """
44 This class is meant to be used statically for all logging
45 purposes in the EDNA framework.
46
47 All methods are thread safe.
48 """
49 __edLogging = EDLogging("EDVerbose")
50
51
57 setTestOn = staticmethod(setTestOn)
58
59
65 setTestOff = staticmethod(setTestOff)
66
67
73 setVerboseOn = staticmethod(setVerboseOn)
74
75
81 setVerboseOff = staticmethod(setVerboseOff)
82
83
89 setVerboseDebugOn = staticmethod(setVerboseDebugOn)
90
91
97 setVerboseDebugOff = staticmethod(setVerboseDebugOff)
98
99
101 """
102 This method returns the current status of debugging
103
104 @return: if debug output to standard output and log file is enabled.
105 @type: boolean
106 """
107 return EDVerbose.__edLogging.isVerboseDebug()
108 isVerboseDebug = staticmethod(isVerboseDebug)
109
110
111 - def log(_strMessage=""):
112 """
113 This method writes a message only to the log file.
114
115 @param _strMessage: The string to be written to the log file
116 @type _strMessage: python string
117 """
118 EDVerbose.__edLogging.log(_strMessage)
119 log = staticmethod(log)
120
121
123 """
124 This method writes a message to standard output and to the log file.
125
126 @param _strMessage: The string to be written to the log file
127 @type _strMessage: python string
128 """
129 EDVerbose.__edLogging.screen(_strMessage)
130 screen = staticmethod(screen)
131
132
133 - def DEBUG(_strDebugMessage=""):
134 """
135 This method writes a debug message to standard output and to the log file
136 if debugging is enabled. The message will be written with the prefix [DEBUG]
137
138 @param _strDebugMessage: The debug message to be written to standard output and log file
139 @type _strDebugMessage: python string
140 """
141 EDVerbose.__edLogging.DEBUG(_strDebugMessage)
142 DEBUG = staticmethod(DEBUG)
143
144
146 """
147 This method is meant to be used by the testing framework. The message will be written
148 to standard output and the log file with the prefix [UnitTest]
149
150 @param _strMessage: The message to be written to standard output and log file
151 @type _strMessage: python string
152 """
153 EDVerbose.__edLogging.unitTest(_strMessage)
154 unitTest = staticmethod(unitTest)
155
156
157 - def ERROR(_strMessage=""):
158 """
159 This method writes a message to standard error and the log file with the prefix [ERROR].
160
161 @param _strMessage: The error message to be written to standard output and log file
162 @type _strMessage: python string
163 """
164 EDVerbose.__edLogging.ERROR(_strMessage)
165 ERROR = staticmethod(ERROR)
166
167
168 - def error(_strMessage=""):
169 """
170 This method writes a message to standard error and the log file with the prefix [ERROR].
171
172 @param _strMessage: The error message to be written to standard output and log file
173 @type _strMessage: python string
174 """
175 EDVerbose.__edLogging.error(_strMessage)
176 error = staticmethod(error)
177
178
180 """
181 This method writes a warning message to standard output and the log file with the prefix [Warning].
182
183 @param _strMessage: The error message to be written to standard output and log file
184 @type _strMessage: python string
185 """
186 EDVerbose.__edLogging.WARNING(_strMessage)
187 WARNING = staticmethod(WARNING)
188
189
191 """
192 This method writes a warning message to standard output and the log file with the prefix [Warning].
193
194 @param _strMessage: The error message to be written to standard output and log file
195 @type _strMessage: python string
196 """
197 EDVerbose.__edLogging.warning(_strMessage)
198 warning = staticmethod(warning)
199
200
202 """
203 This method writes an assert message to standard output and the log file with the prefix [ASSERT].
204
205 @param _strMessage: The error message to be written to standard output and log file
206 @type _strMessage: python string
207 """
208 EDVerbose.__edLogging.ASSERT(_strMessage)
209 ASSERT = staticmethod(ASSERT)
210
211
213 """
214 This method writes an error trace to standard output and the log file. The error trace has
215 the same formatting as normal Python error traces.
216
217 @param _strPrefix: A prefix which can be customized, e.g. the testing framework uses ' [UnitTest]'
218 @type _strPrefix: python string
219 """
220 EDVerbose.__edLogging.writeErrorTrace(_strPrefix)
221 writeErrorTrace = staticmethod(writeErrorTrace)
222
223
225 """
226 This method can be used for customising the file name of the log file.
227
228 @param _strLogFileName: A file name for the log file.
229 @type _strLogFileName: python string
230 """
231 EDVerbose.__edLogging.setLogFileName(_strLogFileName)
232 setLogFileName = staticmethod(setLogFileName)
233
234
240 setLogFileOff = staticmethod(setLogFileOff)
241