aboutsummaryrefslogtreecommitdiff
path: root/src/3rdParty/efsw/Log.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdParty/efsw/Log.cpp')
-rw-r--r--[-rwxr-xr-x]src/3rdParty/efsw/Log.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/3rdParty/efsw/Log.cpp b/src/3rdParty/efsw/Log.cpp
index ddf7a62..6f32df7 100755..100644
--- a/src/3rdParty/efsw/Log.cpp
+++ b/src/3rdParty/efsw/Log.cpp
@@ -1,20 +1,31 @@
1#include <efsw/efsw.hpp> 1#include <efsw/efsw.hpp>
2#include <efsw/Debug.hpp>
2 3
3namespace efsw { namespace Errors { 4namespace efsw { namespace Errors {
4 5
5static std::string LastError; 6static std::string LastError = "";
7static Error LastErrorCode = NoError;
6 8
7std::string Log::getLastErrorLog() { 9std::string Log::getLastErrorLog() {
8 return LastError; 10 return LastError;
9} 11}
10 12
13Error Log::getLastErrorCode() {
14 return LastErrorCode;
15}
16
17void Log::clearLastError() {
18 LastErrorCode = NoError;
19 LastError = "";
20}
21
11Error Log::createLastError( Error err, std::string log ) { 22Error Log::createLastError( Error err, std::string log ) {
12 switch ( err ) { 23 switch ( err ) {
13 case FileNotFound: 24 case FileNotFound:
14 LastError = "File not found ( " + log + " )"; 25 LastError = "File not found ( " + log + " )";
15 break; 26 break;
16 case FileRepeated: 27 case FileRepeated:
17 LastError = "File reapeated in watches ( " + log + " )"; 28 LastError = "File repeated in watches ( " + log + " )";
18 break; 29 break;
19 case FileOutOfScope: 30 case FileOutOfScope:
20 LastError = "Symlink file out of scope ( " + log + " )"; 31 LastError = "Symlink file out of scope ( " + log + " )";
@@ -23,11 +34,15 @@ Error Log::createLastError( Error err, std::string log ) {
23 LastError = 34 LastError =
24 "File is located in a remote file system, use a generic watcher. ( " + log + " )"; 35 "File is located in a remote file system, use a generic watcher. ( " + log + " )";
25 break; 36 break;
37 case WatcherFailed:
38 LastError = "File system watcher failed ( " + log + " )";
39 break;
26 case Unspecified: 40 case Unspecified:
27 default: 41 default:
28 LastError = log; 42 LastError = log;
29 } 43 }
30 44
45 efDEBUG( "%s\n", LastError.c_str() );
31 return err; 46 return err;
32} 47}
33 48