dsrc isn't necessary for this repo
[client-tools.git] / src / external / 3rd / library / perforce / include / errorlog.h
blob5dfc5e48f2acbedecdd896df52dc0ba2bf191930
1 /*
2 * Copyright 1995, 1996 Perforce Software. All rights reserved.
3 */
5 /*
6 * ErrorLog.h - report layered errors
8 * Class Defined:
10 * ErrorLog - write errors to log/syslog (static)
12 * Public methods:
14 * ErrorLog::Report() - blurt out the contents of the Error to stderr
15 * ErrorLog::Abort() - blurt out an error and exit
16 * ErrorLog::Fmt() - format an error message
18 * ErrorLog::SetLog() - redirect Abort() and Report() to named file
19 * ErrorLog::SetTag() - replace standard tag used by Report()
21 * ErrorLog::SetSyslog() - redirect error messages to syslog on UNIX.
22 * ErrorLog::UnsetSyslog() - Cancel syslog redirection. Revert to log file.
26 * class ErrorLog - write errors to log/syslog
29 class ErrorLog {
31 public:
32 static void Abort( const Error *e );
33 static void Report( const Error *e );
35 // Global settings
37 static void SetLog( const char *file );
38 static void SetSyslog() { useSyslog = 1; }
39 static void UnsetSyslog() { useSyslog = 0; }
40 static void SetTag( const char *tag ) { errorTag = tag; }
42 private:
44 static const char *errorTag;
45 static void *errorLog;
46 static int useSyslog;
48 } ;
51 * AssertError() - in case you need a global error to Abort() on
54 extern Error AssertError;