You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

jordi

Intermediate

  • "jordi" started this thread

Posts: 485

Location: Barcelona

Occupation: creating ideas & coding them

  • Send private message

1

Monday, June 29th 2015, 4:40pm

trace with code | message

I think it would be very interesting to have the ability to trace(code, message) just like in the plugins.
everpano.com step beyond 360

2

Tuesday, June 30th 2015, 3:16pm

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

jordi

Intermediate

  • "jordi" started this thread

Posts: 485

Location: Barcelona

Occupation: creating ideas & coding them

  • Send private message

3

Wednesday, July 1st 2015, 12:03pm

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
everpano.com step beyond 360

Posts: 1,850

Occupation: Virtual Tours - Photography - Krpano developer

  • Send private message

4

Friday, July 3rd 2015, 11:52pm

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.

Source code

1
2
3
<strace id="5" color="#ff0000" />

strace(5,layer[sacha].x);

STRACE: layer[sacha].x= 5

strace because s is for sacha.
:)
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

This post has been edited 4 times, last edit by "sachagriffin" (Jul 4th 2015, 12:10am)


5

Sunday, July 3rd 2016, 12:03pm


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

6

Sunday, July 3rd 2016, 12:03pm


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

Taurus

Trainee

Posts: 135

Location: Belarus

Occupation: photographer & virtual tour developer

  • Send private message

7

Sunday, July 3rd 2016, 2:53pm

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

Source code

1
2
3
4
5
6
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

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
	<action name="skin_keydown_event"> 
		if(keycode == 33, skin_nextscene_loop(-1) );               <!-- Page Up   - previous scene -->
		if(keycode == 34, skin_nextscene_loop(+1) );               <!-- Page Dowm - next scene -->
		if(keycode == 35, skin_gotoscene(calc(scene.count-1)) );   <!-- End       - last scene -->
		if(keycode == 36, skin_gotoscene(0) );                     <!-- Home/Pos1 - first scene -->
<!-- trace action name and the value of keycode in yellow -->
       checkaction(%0,get(keycode),ye);
<!--               end of trace                                                     -->
	</action>
	...
	<action name="skin_showmap"> 
<!-- trace action name in green -->
       checkaction(%0,,gr);
<!--        end of trace                  -->
		if(%1 == null, if(layer[skin_map].state == 'closed', set(show,true), set(show,false)); , set(show,%1); );
		mul(mh, layer[skin_scroll_layer].pixelheight, -1);
        ...


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

Source code

1
2
3
4
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
--
in order to comply the word with the affairs, you need to keep quiet and do nothing!

Virtual tour Gomel
Virtual tour
Virtual tour
Elbrus
...

Windows 10x64 & krpano 1.19pr16

8

Friday, August 5th 2016, 10:24pm

Hi,

there are now (1.19-pr6) these actions:
debug()
trace()
warning()
error()
fatalerror()

for having more levels and more control about the trace output.

Best regards,
Klaus