Total members 11895 |It is currently Fri Dec 27, 2024 5:27 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





Code:

<?php
function debug( $line, $msg ){
    static
$calls = 1;
    print
"<P><HR><br>\n";
    print
"DEBUG $calls: Line $line: $msg<br>";
    
$args = func_get_args();
    
    if (  
count( $args ) % 2 )
        print
"Odd number of args<BR>";
    else{
        for (
$x=2; $x< count($args); $x += 2 ){
            print
"&nbsp&nbsp; \$$args[$x]: ".$args[$x+1];
            print
" .... (".gettype( $args[$x+1] ).")<BR>\n";
        }
    }
    print
"<hr><p></p>\n";
    
$calls++;
}

$test = 55;
debug( __LINE__, "First message", "test", $test );

$test = 66;
$test2 = $test/2;
debug( __LINE__, "Second message", "test", $test, "test2", $test2 );
?>




_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : Format Debugging Messages
 Understanding PHP error messages     -  
 Disabling Obtrusive Messages     -  
 Chat client and server, save messages and delete     -  
 PDF Format     -  
 Format Specifier in C     -  
 Number format for current     -  
 Number format function prototype     -  
 Printing today+ current date with different format     -  
 i want to draw a circle on a image(any format bmp,jpeg etc.)     -  
 Handling m3g format (3D files for mobiles) in J2ME     -  



Topic Tags

PHP Exceptions
cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com