mirror of
https://github.com/gnustep/libs-ec.git
synced 2025-02-20 18:32:09 +00:00
Make EcException macros generaqte logs if EcProc is not yet initialised
This commit is contained in:
parent
c796ed2bdf
commit
9b4ebd9c15
1 changed files with 29 additions and 5 deletions
34
EcProcess.h
34
EcProcess.h
|
@ -43,41 +43,65 @@
|
|||
* alarm.
|
||||
*/
|
||||
#define EcExceptionCritical(cause, format, args...) \
|
||||
({ if (nil == EcProc) NSLog(@"%@",\
|
||||
[NSString stringWithFormat: @"%s at %@ line %d ... %@", \
|
||||
(nil == (cause) ? "Code/Data Error (critical)" : "Exception"), \
|
||||
[[NSString stringWithUTF8String: __FILE__] lastPathComponent], __LINE__, \
|
||||
[NSString stringWithFormat: (format), ##args]]); else \
|
||||
[EcProc ecException: (cause) \
|
||||
specificProblem: [NSString stringWithFormat: @"%s at %@ line %d", \
|
||||
(nil == (cause) ? "Code/Data Error (critical)" : "Exception"), \
|
||||
[[NSString stringWithUTF8String: __FILE__] lastPathComponent], __LINE__] \
|
||||
perceivedSeverity: EcAlarmSeverityCritical \
|
||||
message: (format), ##args ]
|
||||
message: (format), ##args ]; \
|
||||
})
|
||||
|
||||
#define EcExceptionMajor(cause, format, args...) \
|
||||
({ if (nil == EcProc) NSLog(@"%@",\
|
||||
[NSString stringWithFormat: @"%s at %@ line %d ... %@", \
|
||||
(nil == (cause) ? "Code/Data Error" : "Exception"), \
|
||||
[[NSString stringWithUTF8String: __FILE__] lastPathComponent], __LINE__, \
|
||||
[NSString stringWithFormat: (format), ##args]]); else \
|
||||
[EcProc ecException: (cause) \
|
||||
specificProblem: [NSString stringWithFormat: @"%s at %@ line %d", \
|
||||
(nil == (cause) ? "Code/Data Error" : "Exception"), \
|
||||
[[NSString stringWithUTF8String: __FILE__] lastPathComponent], __LINE__] \
|
||||
perceivedSeverity: EcAlarmSeverityMajor \
|
||||
message: (format), ##args ]
|
||||
message: (format), ##args ]; \
|
||||
})
|
||||
|
||||
#define EcExceptionMinor(cause, format, args...) \
|
||||
({ if (nil == EcProc) NSLog(@"%@",\
|
||||
[NSString stringWithFormat: @"%s at %@ line %d ... %@", \
|
||||
(nil == (cause) ? "Code/Data Error (minor)" : "Exception"), \
|
||||
[[NSString stringWithUTF8String: __FILE__] lastPathComponent], __LINE__, \
|
||||
[NSString stringWithFormat: (format), ##args]]); else \
|
||||
[EcProc ecException: (cause) \
|
||||
specificProblem: [NSString stringWithFormat: @"%s at %@ line %d", \
|
||||
(nil == (cause) ? "Code/Data Error (minor)" : "Exception"), \
|
||||
[[NSString stringWithUTF8String: __FILE__] lastPathComponent], __LINE__] \
|
||||
perceivedSeverity: EcAlarmSeverityMinor \
|
||||
message: (format), ##args ]
|
||||
message: (format), ##args ]; \
|
||||
})
|
||||
|
||||
/* Diagnostic logging including a stack trace (either from an exception or,
|
||||
* if the exception is nil, from the point at which the log is generated.
|
||||
* This list like the other EcException macros, except that it does not
|
||||
* This is like the other EcException macros, except that it does not
|
||||
* generate an alarm.
|
||||
*/
|
||||
#define EcExceptionDebug(cause, format, args...) \
|
||||
({ if (nil == EcProc) NSLog(@"%@",\
|
||||
[NSString stringWithFormat: @"%s at %@ line %d ... %@", \
|
||||
(nil == (cause) ? "Code/Data Diagnostics" : "Harmless Exception"), \
|
||||
[[NSString stringWithUTF8String: __FILE__] lastPathComponent], __LINE__, \
|
||||
[NSString stringWithFormat: (format), ##args]]); else \
|
||||
[EcProc ecException: (cause) \
|
||||
specificProblem: [NSString stringWithFormat: @"%s at %@ line %d", \
|
||||
(nil == (cause) ? "Code/Data Diagnostics" : "Harmless Exception"), \
|
||||
[[NSString stringWithUTF8String: __FILE__] lastPathComponent], __LINE__] \
|
||||
perceivedSeverity: EcAlarmSeverityClear \
|
||||
message: (format), ##args ]
|
||||
message: (format), ##args ]; \
|
||||
})
|
||||
|
||||
|
||||
@class NSFileHandle;
|
||||
|
|
Loading…
Reference in a new issue