00:0.24 Let's imagine that we need to check out what's happening to the Fibonacci sequence right near
00:6.92 when we hit this break, You could even make this bigger,
00:9.7 we could say this is going to be 10,000 here.
00:13.44 one way to do it would be I'm going to put a breakpoint right here and
00:17.07 press debug and we go over here and we can just run be good step
00:23.92 stop. What does those three?
00:27.39 Okay, it's 5,13 this might take a while to get to something around 10,000.
00:32.74 I could press this button to just run until you hit the next breakpoint.
00:36.48 That's pretty good. Then eventually it exits.
00:41.84 Okay, well I thought maybe there was one higher but I guess this is the
00:45.31 one we want to stop and so as soon as it's over 5000,
00:48.06 let's do this again. Just feeling a little bit cumbersome help so let's go and
00:53.27 actually we could go down here and we could put something like you know you put
00:56.14 'O' in this case and I'll show that.
00:58.69 But what we really could do It is better we could put that test like is
01:2.95 O greater than 5000. I notice we get auto complete of all the things here
01:8.76 but I'm just gonna use the constant 5000 boss,
01:12.65 we could just hit this again until it gets to be true,
01:15.41 click it a little bit, here we go.
01:17.09 True, that's the first one and then I could go and look around here and
01:20.38 see what this value is and so on.
01:23.34 But we can do better still.
01:25.44 Okay imagine you're doing something like reading through a log file parsing through a text file
01:31.99 and you're reading it line by line If there's 5000 lines and there's something going wrong
01:36.99 on one of them. You may well want to say does this text which I
01:40.79 know is where the problem is appear in the line,
01:43.35 we're trying to process something like that.
01:46.14 How do you make that happen?
01:47.19 one. Super cheesy way would be to say if O was greater than 5000 
01:53.02 X=1 and set up at a breakpoint right there that would do it.
02:0.54 Okay, so what is what is O now O it's the 6000 were looking for
02:6.54 but don't do this, you don't need this,
02:8.33 check this out, we'll go back to this breakpoint and then we're gonna right click
02:13.03 and check that out. There's these options,
02:15.07 you can enable it and disable it.
02:17.0 So and it's a breakpoint that's here,
02:19.2 you can come back to you but right now you don't need it,
02:22.54 you can say what you want to suspend the whole program are just the thread and
02:26.14 then you can write code here like O notice the auto complete for all the stuff
02:30.46 that would be here like oh dot but we'll just say O greater than 5000 so
02:39.74 instead of writing that as a placing code where we set a breakpoint on it temporarily
02:43.5 just do it on the breakpoint it again.
02:46.24 Going to stop once, Where is the value?
02:48.52 6765 exactly where we wanted to pause and check things out,
02:54.44 you can also right click on this and there's a little more here.
02:57.74 It's a whole bunch more we can do so this bit you saw already but look
03:1.9 we can log when the breakpoint hits and print out the stack trace to see what
03:6.29 called it to get here. We could evaluate something along so check this out,
03:10.3 we could do like an F string,
03:11.77 we could say the value of O is no auto complete and everything well and we
03:22.63 can also remove it once it's hit if we want or disable other things.
03:27.34 So now run it one more time.
03:32.04 Okay, get hit let's go to the console,
03:34.34 look at that, the value of O is this.
03:37.18 And actually let's do one more quick quick thing let me put over here.
03:41.79 Always have a hard time seeing the log messages because they basically look the same as
03:46.12 everything else. So this is an option here,
03:49.27 we could do that. Let's run it again,
03:53.64 that should make it pretty obvious.
03:56.54 So setting the break point here and logging out what the value is can make our
04:0.74 debugging. Super, super easy.
04:2.64 We skip the non interesting cases by adding a condition and we can evaluate and log
04:6.94 it and then off it goes,
04:8.7 we could even uncheck suspend Here and let's just say this is greater than 500 and
04:15.04 all we'll get is basically a log message,
04:16.85 notice how it turns yellow, so we run this,
04:19.55 it finishes, boom. But then any time it was over 500,
04:23.88 we got that breakpoint became basically a conditional logger.
04:27.88 And then if you don't want any more boom,
04:29.58 it's gone. So, so many amazing things you can do with conditional breakpoints.
04:34.64 It's easy to just see them as on and off.
04:37.2 Little red buttons try to remember to take advantage of them in the situations where it
04:41.41 will really, really help you.
