Changeset 507 for branches/client-2.0/src/debug.c
- Timestamp:
- Dec 28, 2010, 10:47:09 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/client-2.0/src/debug.c
r497 r507 30 30 #include <sys/stat.h> 31 31 32 int debuglevel = 9; // we set it to 9, so we get all messages32 int debuglevel = 1; // we set it to 9, so we get all messages 33 33 char logfile[_MAX_PATH +1] = {0}; 34 34 char debugfile[_MAX_PATH +1] = {0}; … … 43 43 BOOL writeLog() 44 44 { 45 45 return do_logging; 46 46 } 47 47 48 48 void debuglocal(int level, const char * fmt, ...) 49 49 { 50 51 50 FILE *f=NULL; 51 struct stat filestat; 52 52 53 54 if (!debuglvl(level))53 // do we have to log at all 54 /* if (!debuglvl(level)) 55 55 { 56 56 return; 57 } 57 } */ 58 58 59 60 61 62 63 64 65 66 67 68 59 // if the file ndpsmb.dbg is around we write a logfile 60 if (!debugfile[0]) 61 { 62 strncpy(debugfile, getenv("ETC"), 2); 63 strncat(debugfile, "\\", sizeof(debugfile) - strlen(debugfile) -1); 64 strncat(debugfile, "ndpsmb.dbg", sizeof(debugfile) - strlen(debugfile) -1); 65 } /* endif */ 66 67 if (stat(debugfile, &filestat) !=0) 68 return; 69 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 70 //we create the logfile variable only once 71 if (!logfile[0]) 72 { 73 char *env = getenv("LOGFILES"); 74 if (env != NULL) 75 { 76 strncpy(logfile, env, sizeof(logfile) -1); 77 strncat(logfile, "\\", sizeof(logfile) - strlen(logfile) -1); 78 strncat(logfile, logfilename, sizeof(logfile) - strlen(logfile) -1); 79 } 80 else 81 { 82 strncpy(logfile, logfilename, sizeof(logfile) -1); 83 } 84 // set the samba logging stuff 85 do_logging = TRUE; 86 } /* endif */ 87 87 88 88 do
Note:
See TracChangeset
for help on using the changeset viewer.