Logasm is a cross-browser open-source (GPL) JavaScript log application.
Logasm provides a way to log what has happened and what is happening on the current page of your website. This can be very useful for developers, as you might not even need to debug anymore. I have often found it annoying trying to find which of the many SQL statements has gone wrong. With logasm you can write a sql wrapper, that outputs your query so that it is captured in the log.
e.g. PHP & mysql:
function _mysql_query($sql,$file){
logasm_out("<b>"+$file+"</b><br>"+$sql,"SQL");
$result = mysql_query($sql) or logasm_push("SQL","<b>".mysql_error()."</b><br>".$sql,array('time'=>time()));
return $result;
}
//call the function
_mysql_query('SELECT * FROM test',__FILE__);
//as logasm_push only stores the data, call logasm_push to output the data
//to output direktly, use logasm_out instead of push
logasm_display();
Basically you can capture any kind of output from your website. Even HTML will work in most cases, although this might depend on the browser you chose.
At the top of the page, you can see a sample use of Logasm. You can add more log messages dynamically by using the input fields on the left. Just give it a try.
Getting StartedDownload the latest version of Logasm and unpack the zip. You will then have the code of this site on your harddisk.
To add Logasm to your own site, simply include following lines in your websites header:
<script type="text/javascript" src="logasm/logasm.js"></script>
<link href='logasm/logasm.css' rel='stylesheet' type='text/css'>
If you like it, don't forget to link to this site!
Why Logasm?After spending hours trying to find a suitable short .com domain name, I had to start thinking far outside the box. It's unbelievable how many domains have already been parked. Quite scary. However, I got a little crazy and finally came up with this brilliant, but slightly seedy name. Ok, not brilliant, but at least it's kind of fun.