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 4 and 5

1 2 3 4 5
1 2 3 4 5

  1. trunk/main/logger.c: Loading...
trunk/main/logger.c
Diff Revision 4 Diff Revision 5
[20] 234 lines
[+20] [+] static unsigned int make_components(const char *s, int lineno)
235

    
   
235

   
236
static struct logchannel *make_logchannel(const char *channel, const char *components, int lineno)
236
static struct logchannel *make_logchannel(const char *channel, const char *components, int lineno)
237
{
237
{
238
	struct logchannel *chan;
238
	struct logchannel *chan;
239
	char *facility;
239
	char *facility;

    
   
240
	struct ast_tm tm;

    
   
241
	struct timeval now = ast_tvnow();

    
   
242
	char datestring[256];
240

    
   
243

   
241
	if (ast_strlen_zero(channel) || !(chan = ast_calloc(1, sizeof(*chan) + strlen(components) + 1)))
244
	if (ast_strlen_zero(channel) || !(chan = ast_calloc(1, sizeof(*chan) + strlen(components) + 1)))
242
		return NULL;
245
		return NULL;
243

    
   
246

   
244
	strcpy(chan->components, components);
247
	strcpy(chan->components, components);
[+20] [20] 39 lines
[+20] static struct logchannel *make_logchannel(const char *channel, const char *components, int lineno)
284
			ast_console_puts_mutable(strerror(errno), __LOG_ERROR);
287
			ast_console_puts_mutable(strerror(errno), __LOG_ERROR);
285
			ast_console_puts_mutable("'\n", __LOG_ERROR);
288
			ast_console_puts_mutable("'\n", __LOG_ERROR);
286
			ast_free(chan);
289
			ast_free(chan);
287
			return NULL;
290
			return NULL;
288
		} else {
291
		} else {
289
			fprintf(chan->fileptr, "Asterisk %s built by %s @ %s on a %s running %s on %s\n",
292
			/* Create our date/time */
290
				ast_get_version(), ast_build_user, ast_build_hostname,
293
			ast_localtime(&now, &tm, NULL);

    
   
294
			ast_strftime(datestring, sizeof(datestring), dateformat, &tm);

    
   
295

   

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

    
   
297
				datestring, ast_get_version(), ast_build_user, ast_build_hostname,
291
				ast_build_machine, ast_build_os, ast_build_date);
298
				ast_build_machine, ast_build_os, ast_build_date);
292
			fflush(chan->fileptr);
299
			fflush(chan->fileptr);
293
		}
300
		}
294
		chan->type = LOGTYPE_FILE;
301
		chan->type = LOGTYPE_FILE;
295
	}
302
	}
[+20] [20] 1378 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.