trace with code | message

  • Hi,

    that would be possible, but what would be the intended usage case?

    Tracing debug or warning messages?

    Tracing error messages will be already possible in the next release by using 'error(message, false);' - when adding the false as second parameter a normal error instead of a fatal error will be shown.


    Adding an additional first parameter to the trace() action itself would break compatibility, so therefore a new action would be required - any suggestions for this? e.g. ltrace(level, ...); or debug(...); and warning(...); ?

    Best regards,
    Klaus

  • Hi,

    intended usage case, is being able to have as many traces as needed in the code for the production, and once is finished the code in order to improve performance, don't need to remove or comment the traces action, just turn them off.
    So I guess debug(...) and warning(..) would be a great solution.

    Thanks

  • Thats a cool idea. Give traces an id, so that you can turn whole categories on and off. id's would be the way to go, so that you can trace out particular things across functions.
    I guess you'd need a way to turn off on a particular id and then a method to turn them all off.
    Having a color you can set for id'd traces would be sweet as well.

    Also, I'd like to short the syntax to that if you trace a string it shows the string and value automatically. Would save a ton of typing.

    Code
    <strace id="5" color="#ff0000" />
    
    
    strace(5,layer[sacha].x);


    STRACE: layer[sacha].x= 5

    strace because s is for sacha.
    :)


  • Adding an additional first parameter to the trace() action itself would break compatibility, so therefore a new action would be required - any suggestions for this? e.g. ltrace(level, ...); or debug(...); and warning(...); ?

    i second that request too...

    atm i use my own js_trace(code, ...) to allow a green "debug:" line
    but to have debug(), warning() would be nicer
    maybe even better would be dtrace(code, ...) working the same as the js krpano.trace()

    a global variable debug= false could then suppress all debug/warning outputs


  • Adding an additional first parameter to the trace() action itself would break compatibility, so therefore a new action would be required - any suggestions for this? e.g. ltrace(level, ...); or debug(...); and warning(...); ?

    i second that request too...

    atm i use my own js_trace(code, ...) to allow a green "debug:" line
    but to have debug(), warning() would be nicer
    maybe even better would be dtrace(code, ...) working the same as the js krpano.trace()

    a global variable debug= false could then suppress all debug/warning outputs

  • Hi,
    for debugging complex tours, I use selfmade tracer
    it displays two types of information:
    - continuous tracing preset variables (amount - up to 6) is set at startup

    Code
    check_1(keycode);
    check_2(view.vlookat);
    check_3(layer[skin_map].state);
    check_4(layer[skin_map].visible);
    check_5(layer[skin_thumbs].state);
    check_6(my_var_to_trace);


    - signal when predefined action is executed to trace a value up to two variables
    for example, tracing some of the actions in the vtourskin.xml

    Enabling/disabling tracing is made from the address bar like the following

    Code
    http://3dpano.by/parkhotel/patio/test/index.html?check=true
    http://3dpano.by/parkhotel/patio/test/index.html?check=false
     or
    http://3dpano.by/parkhotel/patio/test

    Example trace standard krpano tour you can look at this link

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!