Review Board 1.7.16


log Asterisk Version number, Build etc into log file

Review Request #1409 - Created Sept. 2, 2011 and submitted

Alec Davis
trunk
Reviewers
asterisk-dev
Asterisk
When the question is asked what was the last version that worked? You'd of thought looking through the logs it would be reported.
asterix:/var/log/asterisk# head messages
Asterisk SVN-trunk-r333838M built by root @ asterix on a i686 running Linux on 2011-05-27 11:52:02 UTC
[2011-09-05 21:13:25.672533] NOTICE[27089] loader.c: 1 modules will be loaded.
[2011-09-05 21:13:25.693952] WARNING[27089] http.c: Got 1 addresses

Changes between revision 3 and 4

1 2 3 4 5
1 2 3 4 5

  1. trunk/main/logger.c: Loading...
trunk/main/logger.c
Diff Revision 3 Diff Revision 4
[20] 45 lines
[+20] [+] ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
46
#include "asterisk/threadstorage.h"
46
#include "asterisk/threadstorage.h"
47
#include "asterisk/strings.h"
47
#include "asterisk/strings.h"
48
#include "asterisk/pbx.h"
48
#include "asterisk/pbx.h"
49
#include "asterisk/app.h"
49
#include "asterisk/app.h"
50
#include "asterisk/syslog.h"
50
#include "asterisk/syslog.h"
51
#include "asterisk/buildinfo.h" 
51
#include "asterisk/buildinfo.h"
52
#include "asterisk/ast_version.h" 
52
#include "asterisk/ast_version.h"
53

    
   
53

   
54
#include <signal.h>
54
#include <signal.h>
55
#include <time.h>
55
#include <time.h>
56
#include <sys/stat.h>
56
#include <sys/stat.h>
57
#include <fcntl.h>
57
#include <fcntl.h>
[+20] [20] 225 lines
[+20] [+] static struct logchannel *make_logchannel(const char *channel, const char *components, int lineno)
283
			ast_console_puts_mutable("': ", __LOG_ERROR);
283
			ast_console_puts_mutable("': ", __LOG_ERROR);
284
			ast_console_puts_mutable(strerror(errno), __LOG_ERROR);
284
			ast_console_puts_mutable(strerror(errno), __LOG_ERROR);
285
			ast_console_puts_mutable("'\n", __LOG_ERROR);
285
			ast_console_puts_mutable("'\n", __LOG_ERROR);
286
			ast_free(chan);
286
			ast_free(chan);
287
			return NULL;
287
			return NULL;

    
   
288
		} else {

    
   
289
			fprintf(chan->fileptr, "Asterisk %s built by %s @ %s on a %s running %s on %s\n",

    
   
290
				ast_get_version(), ast_build_user, ast_build_hostname,

    
   
291
				ast_build_machine, ast_build_os, ast_build_date);

    
   
292
			fflush(chan->fileptr);
288
		}
293
		}
289
		chan->type = LOGTYPE_FILE;
294
		chan->type = LOGTYPE_FILE;
290
	}
295
	}
291
	chan->logmask = make_components(chan->components, lineno);
296
	chan->logmask = make_components(chan->components, lineno);
292

    
   
297

   
[+20] [20] 107 lines
[+20] [+] static void init_logger_chain(int locked, const char *altconf)
400
			ast_console_puts_mutable("'\n", __LOG_ERROR);
405
			ast_console_puts_mutable("'\n", __LOG_ERROR);
401
			continue;
406
			continue;
402
		}
407
		}
403
		AST_RWLIST_INSERT_HEAD(&logchannels, chan, list);
408
		AST_RWLIST_INSERT_HEAD(&logchannels, chan, list);
404
		global_logmask |= chan->logmask;
409
		global_logmask |= chan->logmask;
405
//		fprintf(chan->fileptr, "Asterisk %s built by %s @ %s on a %s running %s on %s\n", 

   
406
//			ast_get_version(), ast_build_user, ast_build_hostname, 

   
407
//			ast_build_machine, ast_build_os, ast_build_date); 

   
408

    
   

   
409
	}
410
	}
410

    
   
411

   
411
	if (qlog) {
412
	if (qlog) {
412
		fclose(qlog);
413
		fclose(qlog);
413
		qlog = NULL;
414
		qlog = NULL;
[+20] [20] 1259 lines
  1. trunk/main/logger.c: Loading...

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.