- /*
- * Copyright 1995, 1996 Perforce Software. All rights reserved.
- */
- /*
- * ErrorLog.h - report layered errors
- *
- * Class Defined:
- *
- * ErrorLog - write errors to log/syslog (static)
- *
- * Public methods:
- *
- * ErrorLog::Report() - blurt out the contents of the Error to stderr
- * ErrorLog::Abort() - blurt out an error and exit
- * ErrorLog::Fmt() - format an error message
- *
- * ErrorLog::SetLog() - redirect Abort() and Report() to named file
- * ErrorLog::SetTag() - replace standard tag used by Report()
- *
- * ErrorLog::SetSyslog() - redirect error messages to syslog on UNIX.
- * ErrorLog::UnsetSyslog() - Cancel syslog redirection. Revert to log file.
- */
- class FileSys;
- /*
- * class ErrorLog - write errors to log/syslog
- */
- class ErrorLog {
- public:
- ErrorLog(){
- useSyslog = 0;
- errorTag = "Error";
- errorFsys = 0;
- }
- ErrorLog( ErrorLog *from );
- ~ErrorLog();
- void Abort( const Error *e );
- void Report( const Error *e ){ Report( e, 1 ); }
- void ReportNoTag( const Error *e ){ Report( e, 0 ); }
- void Report( const Error *e, int tagged );
- void LogWrite( const StrPtr & );
- // Utility methods
- offL_t Size();
- int Exists() { return errorFsys != 0; }
- const char *Name();
- // Global settings
- void SetLog( const char *file );
- void SetSyslog() { useSyslog = 1; }
- void UnsetSyslog() { useSyslog = 0; }
- void SetTag( const char *tag ) { errorTag = tag; }
- private:
- const char *errorTag;
- int useSyslog;
- FileSys *errorFsys;
- } ;
- /*
- * AssertError() - in case you need a global error to Abort() on
- */
- extern Error AssertError;
- extern ErrorLog AssertLog;
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 7893 | Johan Nilsson | OFFLINE CHANGELIST 10 - SUBMITTED ON 2011/03/23 11:18:27 Upgrade project files to VS2010... and switching to msbuild for the entire project. Retargeted everything to .NET4 Client Profile for the time being, due to VS2010 C++ limitations (can't target anything other than 4.0 without complicating the setup too much). Shouldn't be too hard to retarget later if push comes to shove. Added VS2010 P4API stuff directly inside this project also to make things easier to get up and running for the moment. Removed old static P4API libraries. ____________________________________________________________ OFFLINE CHANGELIST 9 - SUBMITTED ON 2011/03/22 07:35:31 Converted to VS2010 « |
14 years ago |