# Logging

**URL:** <https://forum.inductiveautomation.com/t/logging/2354>\
**Category:** Ignition\
**Created:** [November 18, 2010, 3:06pm UTC](https://forum.inductiveautomation.com/t/logging/2354 "2010-11-18T15:06:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Step7](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@Step7](https://forum.inductiveautomation.com/u/Step7)\
**Post date:** [November 18, 2010, 3:06pm UTC](https://forum.inductiveautomation.com/t/logging/2354/1 "2010-11-18T15:06:41Z")

</div>

I’m not sure if this is possible, but I’ll put it out there.

Let’s say I have something like this:

```auto
try:
	system.runQuery(q)
except:
	print "Query Failed"
```

In the print statement, would it be possible to somehow pass in the line number, so I saw something like “Query Failed at line 54”. This would be helpful if I am calling a function from multiple places, and would give me the same useful information that the error dialog would give if I didn’t use try/except.

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [November 18, 2010, 5:16pm UTC](https://forum.inductiveautomation.com/t/logging/2354/2 "2010-11-18T17:16:47Z")

</div>

Try something like this:

`import sys
frame = sys._getframe(0)
print "line: ", frame.f_lineno`

---

<div class="post-metadata">

**Author:** ![Step7](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@Step7](https://forum.inductiveautomation.com/u/Step7)\
**Post date:** [November 19, 2010, 1:27pm UTC](https://forum.inductiveautomation.com/t/logging/2354/3 "2010-11-19T13:27:48Z")

</div>

Just the ticket! Thanks. And while we’re on the subject of debugging and logging…

Would it be hard to add a feature where function calls were set in bold or to a different color? It would help with more complex scripts where there are a lot of calls.

---

<div class="post-metadata">

**Author:** ![whitecows](https://avatars.discourse-cdn.com/v4/letter/w/49beb7/32.png) [@whitecows](https://forum.inductiveautomation.com/u/whitecows)\
**Post date:** [November 24, 2010, 10:40pm UTC](https://forum.inductiveautomation.com/t/logging/2354/4 "2010-11-24T22:40:01Z")

</div>

Step7,

I am located in Boston and was wondering if you were available for a side discussion. Please contact me at [Ryan@FeedResource.com](mailto:Ryan@FeedResource.com)

Thanks,

Ryan

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [December 3, 2010, 5:34pm UTC](https://forum.inductiveautomation.com/t/logging/2354/5 "2010-12-03T17:34:07Z")

</div>

Sure, we could update the syntax highlighter to emphasize function calls somehow.
