예제 #1
0
파일: log.c 프로젝트: jelmer/ctrlproxy
void log_entry(enum log_level level, const struct irc_network *n, const struct irc_client *c, const char *data)
{
	if (flog == NULL)
		return;

	if (level > current_log_level)
		return;

	if (level < LOG_DATA)
		admin_log(level, n, c, data);
	
	if (!no_log_timestamp)
		fprintf(flog, "[%s] ", get_date());
	
	g_assert(strchr(data, '\n') == NULL);
	fprintf(flog, "%s", data);

	if (n) {
		fprintf(flog, " (%s", n->name);

		if (c)
			fprintf(flog, "/%s", c->description);

		fprintf(flog, ")");
	}

	fprintf(flog, "\n");
	fflush(flog);
}
예제 #2
0
파일: IpList.cpp 프로젝트: starius/thechess
IpList::IpList(const std::string& ip, Wt::WContainerWidget* parent):
    WContainerWidget(parent) {
    if (!tApp->user() || !tApp->user()->has_permission(REGISTRATION_BANNER)) {
        return;
    }
    model_ = new IpListModel(ip, this);
    admin_log("List users of IP " + ip_a(ip), true);
    initialize();
}
예제 #3
0
파일: IpList.cpp 프로젝트: starius/thechess
IpList::IpList(const UserPtr& user, Wt::WContainerWidget* parent):
    WContainerWidget(parent) {
    if (!tApp->user() || !tApp->user()->has_permission(REGISTRATION_BANNER)) {
        return;
    }
    model_ = new IpListModel(user, this);
    admin_log("List IP of " + user_a(user.id()), true);
    initialize();
}