forked from freesurfer/freesurfer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rf: cleanup error handling and logging (freesurfer#686)
* rf: cleanup error handling and logging * bf: fix dummy mismatch * use newlines for freeview * turn off colors for now
- Loading branch information
Showing
8 changed files
with
252 additions
and
390 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
#include <iostream> | ||
|
||
#include "log.h" | ||
#include "timer.h" | ||
|
||
|
||
int main(int argc, const char **argv) { | ||
logDebug << currentDateTime(); | ||
std::cout << currentDateTime(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,6 @@ | ||
/** | ||
* @file error.h | ||
* @brief error handling prototypes | ||
* | ||
*/ | ||
/* | ||
* Original Author: Bruce Fischl | ||
* CVS Revision Info: | ||
* $Author: greve $ | ||
* $Date: 2015/07/27 20:49:35 $ | ||
* $Revision: 1.21 $ | ||
* | ||
* Copyright © 2011 The General Hospital Corporation (Boston, MA) "MGH" | ||
* | ||
* Terms and conditions for use, reproduction, distribution and contribution | ||
* are found in the 'FreeSurfer Software License Agreement' contained | ||
* in the file 'LICENSE' found in the FreeSurfer distribution, and here: | ||
* | ||
* https://surfer.nmr.mgh.harvard.edu/fswiki/FreeSurferSoftwareLicense | ||
* | ||
* Reporting: [email protected] | ||
* | ||
*/ | ||
#pragma once | ||
|
||
|
||
#ifndef ERROR_H | ||
#define ERROR_H | ||
|
||
#include <stdio.h> | ||
#include <stdarg.h> | ||
|
||
int ErrorInit(char *fname, | ||
int (*vfprint)(FILE *fp, const char *fmt, va_list args), | ||
int (*vprint)(const char *fmt, va_list args)) ; | ||
int ErrorSetExitFunc(void (*exit_func)(int ecode)) ; | ||
void ErrorExit(int ecode, const char *fmt, ...) ; | ||
int ErrorPrintf(int ecode, const char *fmt, ...) ; | ||
void SetErrorExitDoneFile(char *DoneFile); | ||
int ErrorWriteDoneFile(char *DoneFile, int errorcode); | ||
#define ErrorReturn(ret, args) { ErrorPrintf args ; return(ret) ; } | ||
|
||
#define ESCAPE ErrorExit | ||
#define ErrorSet ErrorPrintf | ||
/* error codes */ | ||
|
||
#define NO_ERROR 0 | ||
#define ERROR_NONE NO_ERROR | ||
#define ERROR_NO_FILE -1 | ||
#define ERROR_NOFILE ERROR_NO_FILE | ||
#define ERROR_NO_MEMORY -2 | ||
#define ERROR_NOMEMORY ERROR_NO_MEMORY | ||
#define ERROR_UNSUPPORTED -3 | ||
#define ERROR_BADPARM -4 | ||
#define ERROR_BAD_PARM ERROR_BADPARM | ||
#define ERROR_BADFILE -5 | ||
#define ERROR_BAD_FILE ERROR_BADFILE | ||
#define ERROR_SIZE -6 | ||
#define ERROR_BADLOOP -7 | ||
#define ERROR_OUT_OF_BOUNDS -8 | ||
|
||
extern int Gerror ; /* global error value */ | ||
|
||
#endif | ||
// Error functions have been moved to log.h - | ||
// this file is a temporary bridge to avoid modifying every file that | ||
// includes it, but eventally it should be removed. | ||
#include "log.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.