File: log.cc

package info (click to toggle)
ht 2.1.0%2Brepack1-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 5,796 kB
  • ctags: 15,915
  • sloc: cpp: 88,932; ansic: 12,693; sh: 4,081; lex: 226; makefile: 184; yacc: 128
file content (38 lines) | stat: -rw-r--r-- 1,091 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
 *	HT Editor
 *	log.cc
 *
 *	Copyright (C) 1999-2002 Stefan Weyergraf
 *
 *	This program is free software; you can redistribute it and/or modify
 *	it under the terms of the GNU General Public License version 2 as
 *	published by the Free Software Foundation.
 *
 *	This program is distributed in the hope that it will be useful,
 *	but WITHOUT ANY WARRANTY; without even the implied warranty of
 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *	GNU General Public License for more details.
 *
 *	You should have received a copy of the GNU General Public License
 *	along with this program; if not, write to the Free Software
 *	Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include "htapp.h"
#include "log.h"
#include "snprintf.h"

void ht_logf(int color, const char *format, ...)
{
	char buf[256];
	va_list arg;
	va_start(arg, format);
	ht_vsnprintf(buf, sizeof buf, format, arg);
	va_end(arg);
	loglines->log(color, buf);

	ht_window *w = ((ht_app*)app)->get_window_by_type(AWT_LOG);
	if (w) w->sendmsg(msg_log_changed);
	app->sendmsg(msg_draw);
}