02Geek HTML5 and JavaScript, TypeScript, React, Flash, ActionScript online School
Previous VideoNext Video

Ec.log

How to monitor your current running events. This video shows in detail how to work with the EC.log.rn

Video Transcript

00:01So we've looked at how we add events and we've looked at how we could remove events and the last item that we have left
00:09Open is how do we log events? How do we actually see at any given time at any point in time?
00:14What are the current events that are actually running for that? I'm going to create one more button
00:20So if we scroll down and we're just going to grab our controller which we use to remove events
00:25I'm just going to duplicate it
00:28paste it again and
00:32Instead of calling on remove events. Let's change a color again, so we could find it more easily
00:38So let's do this time
00:40blue ish
00:44Rectangle and
00:48Let's call instead of on remove events. Let's call on log events
00:55Okay, now the next thing I want to do is I want to take my on remove events, which we had already previously
01:03kind of early and
01:07We are going to just duplicate
01:09our on remove events and call it on log events
01:17Perfect. So now we have an on log events, and we don't really want to remove
01:23Anything here and we want to go through I want to go through and show you all the different variations of how you could work
01:29With the log events so the first way before we even run it
01:32Let's just make sure that our event is being triggered and when we call on log events this trace will happen
01:39so I'm going to run the application again and
01:44We would be blue which is this one and you can see that our arrow
01:50We're getting output
01:52Perfect now because our our rectangle is blue and it's basically the same blue. So let's try maybe let's make it
02:00Let's make it black
02:05Perfect. So now it stands out
02:07okay, so we have our button it stands out and
02:11Let's start playing with the log events
02:13So the first way you can work with the log event is basically by clicking EC typing EC and then you call log
02:19You don't have to put anything in the parameters as soon as you do that and you run the application
02:25Whenever you're gonna click on the log, it's gonna click on the button
02:28It's gonna log in output all the different events that are currently running. So if I just click on it
02:34You'll see that a huge output was just output it's I'm gonna copy this output open up
02:40into a new window, so it'll be easier to see it and
02:45Now we can actually see all of our output
02:47So we see our previous outputs and it's basically clustering or it's showing us our clusters. For example, we had your main five red click and
02:56These are all the items are associated with that cluster
02:59And you are the blue row and all the items associated with that cluster
03:04And you can see that it's breaking down
03:07cluster by cluster showing us all the
03:10information detailed information of all the items that are associated with their instance name and
03:17The use capture the listener the type the name and the object itself
03:22Now the unclustered is if we we haven't set a cluster to an object it would
03:28Classify it into an unclustered event. So which means that from what we could see here that we have two events that aren't being clustered
03:35Let's look them. Let's look them up and see where are we actually calling events? They're not being clustered and
03:43Here we go. So this is one event that's not being clustered. Here's another event that's not being clustered. So automatically
03:50The output the the EC clusters unclustered events and places them in an unclustered
03:57identifier
03:59So so we see that there's quite a lot of events going on right now. So if I clear my
04:04Clear the output and return to return to our Swift
04:08Let's try to click on the green button, which removes events. But before we do it, we probably should set it to remove some events
04:16So let's go to our on remove event and we could see that here that it's removing every click item
04:23So we're looking at the current event before we even change anything. We'll see we have our role
04:28we will roll out roll out and we have our blue click and
04:32We have our red click that red click is even the first item
04:37Okay, so if we run the application again, and we'll first click on the green item, which will is going to deactivate
04:45Our click events and we'll run a log now
04:50Let's see what output we get someone to copy the output again. Let me override everything here
04:58And you will see that now there's only there's the role events but the click clicks are gone
05:06So if for example we wanted to remove all events
05:11That are associated with our project and now because we have your two buttons that are not associated with the project right now, which is the
05:18Log events and they remove events. So let's some add in let's add a
05:24regular expression for the uid to remove based on the uid so
05:29Uid and the regular expressions in the remove events. We're gonna keep our log in the same way. So the classic log
05:36Now if you run the application again, we click on the green button
05:39That's gonna get rid of almost all the events besides these two events. We're gonna press on our
05:45On our log now our log is gonna be just a little log that shows us that we have two unclustered items
05:52And it gives us a list of all the objects are being tracked which are the two items as well
05:58Okay, so we so we've seen now the basics of how to work with log
06:03now
06:04Log you get much more fancy. So it's very similar to the way that we work with remove we could log
06:11Well, this wouldn't be relevant because we can't log us. There's only one event. There would be no point to that
06:16But we could log a certain object. So for example
06:21Let's try to see so our current because this MC would generate an error because there's no variable called MC
06:27Let's go to our event at target
06:29so we're just gonna
06:31Try to see a log of the specific button that we clicked on which is our log event itself
06:37So let's see how many events are associated with that object
06:40It'll see there's only one event associated with it and to list out that one event, which is a click event
06:50Perfect
06:51So now that we've seen how to work with one object at a time we could send a log
06:56We could see everything we could see only one object if we wanted to we could also log a specific ID
07:03So let's grab a specific ID. Let's say we want to log only the blue clicks. So you could grab the blue clicks
07:11And as you can see it's very similar to the way you would work with the remove all I'm really doing here is
07:17Sending the same the same type of parameters. So, okay. So now we're gonna log only only the one cluster
07:25Publish the file click on our black button. It's almost out of the stage and
07:31Let's just grab this and put it inside of our opened window
07:36And you'll see that it's only outputting
07:39It's only outputting our clicks, which is only the blue click and it's showing us all the objects associated
07:48with the event controller
07:52Cool. So now we've seen that we could actually work with the log getting a complete full output
07:56We could get an output only for one specific object or we could get an output for a specific cluster
08:02But same same way same deal works for the log which you could send it a regular expression
08:08So if we wanted to log all the click events
08:11For example all the click all the sorry all the clusters that have the word click in them
08:16We could send a regular expression and now when we run our log and we output our log
08:21We're gonna get
08:23Copy that again
08:25Paste that inside here. We're gonna get all the events that are associated with the word click
08:30So we have our red click cluster and if we toggle down we have our blue click cluster
08:37so with that said that's
08:39All the basic functionality that you get out of the event controller
08:43Which you've seen how to do all the ads
08:45you've seen how to remove events and you've seen how to log events and
08:48The functionality of log and remove are basically the same thing besides that
08:53Log doesn't you can't log one event at a time because it doesn't really even make sense because if you know all that information
08:58Then there's no need to log you
09:01so that covers that covers on
09:06All that it's related to the EC or the event controller in the next chapter
09:11We're gonna go quickly over one more component, which is the LEC and understand when would we use the LEC so far?
09:19We've only used the EC the functionality of the LEC is
09:23Almost the same. Well, it's the exact same thing only with one difference which we'll talk about in the next lesson

Ready to Level Up Your Skills?

Join thousands of learners on 02GEEK and start your journey to becoming a coding expert today!

Enroll Now for Free!