diff server.js @ 4:f630f4b90564

Remove the old log system and use console.log instead.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Mon, 19 Sep 2011 01:51:12 -0700
parents 2e2a2154efbb
children 29becdd02dea
line wrap: on
line diff
--- a/server.js
+++ b/server.js
@@ -337,11 +337,6 @@ var home = function(res, title, desc, bo
 	}
 
 	res.write('\n');
-	res.write('		<section hidden="">\n');
-	res.write('			<h2>logs</h2>\n');
-	res.write('			<div id="log"></div>\n');
-	res.write('		</section>\n');
-	res.write('\n');
 
 	if (!footer)
 		res.write('		<footer/>\n');
@@ -357,10 +352,13 @@ var home = function(res, title, desc, bo
 	}
 
 	res.write('	</body>\n');
+	console.log('It works!');
 	res.end('</html>\n');
 };
 
 http.createServer(function(req, res) {
+	util.log('Connection from ' + (req.headers['x-forwarded-for'] || req.client.remoteAddress) + ' (' + req.headers['user-agent'] + ') to ' + req.method.toLocaleLowerCase() + ' “' + req.url + '” from ' + req.headers['referer'] + '.');
+
 	var re = new RegExp('^' + config.webRoot);
 	req.url = req.url.replace(re, '');
 	var ext = req.url.substring(req.url.lastIndexOf('.')+1);