WCmore's LogAndTrace

From webCoRE Wiki - Web-enabled Community's own Rule Engine
Revision as of 09:34, 8 March 2020 by WCmore (talk | contribs)
Jump to: navigation, search
Share on FacebookShare on TwitterShare on Google+Share on LinkedInShare on DiggShare on deliciousShare on redditShare on StumbleUpon

Introduction to Logs

When we need to troubleshoot a piston's logic, it often helps to see what is happening "behind-the-scenes"... Usually the first step is to turn the Logging Level to "Full" for that piston. (each piston's logs are independent of each other) You will find this option at the bottom of each piston.

LogLevel3.jpg

Once Logging Level is set to Full, then all activity in that piston will be recorded down below that piston. (most recent events at the top) Once the Log runs out of room, the old data is automatically deleted off the bottom, to make room for the new data at the top. (the smaller the piston, the more available room for the log)



Introduction to Trace

On simple problems, simply changing the Log level might give enough information to diagnose... But with a complex piston or log, I will rarely even look at a log unless "Trace" is also turned on. This button can be found on every piston's main page. (not while editing)

Buttons Trace.jpg

Where's the Button?

Sometimes on a new piston, you will not see the "Trace" button:

Buttons NoTrace.jpg

In those cases, press "Test" first, and then you will be able to turn on "Trace".



Summary

Once "Trace" is turned on, you will notice extra numbers in your green snapshot that aligns with the Condition #'s in your log. (As seen in this sample piston)

TraceAndLog.jpg

This makes is easy to follow along, line by line, and see right away what line of code caused an error.



Personal Thoughts

Sometimes, the log can get crazy long. It is MUCH easier to troubleshoot when only the relevant log is posted to the forums.

What I always recommend is:

  • Turn on Trace
  • Set Logging Level to Full
  • Clear Log (Crucial Step!)
Test piston using the normal trigger
Trigger.jpg
  • Wait 10+ seconds after the piston completes all of it's tasks
  • Copy the log & paste into your thread
  • Post a green snapshot that matches the log

What this does is give the experts all the information, without a bunch of clutter to wade through.



Pro Tips

  • Do not ever Edit a piston, and then post a log. We need to see the piston in the same state as when the log was written.
  • On that note, if you edit a piston, you may as well Clear your logs, and run your test again. (the old logs no longer apply)
  • Once a piston has been rock solid reliable for awhile, I often reduce Logging level to Minimum or None
  • You can manually add nearly anything to the log, as seen on line 20 above. (Manual logs will always show, even if Logging Level is set to None)



WCmore's Tips - Table of Contents











.