# Creating a scanner - logging messages - windows

**URL:** <https://forums.plex.tv/t/creating-a-scanner-logging-messages-windows/54126>\
**Category:** Dev/API Corner\
**Tags:** scanner-agent-dev\
**Created:** [January 14, 2014, 9:11pm UTC](https://forums.plex.tv/t/creating-a-scanner-logging-messages-windows/54126 "2014-01-14T21:11:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![iisfaq](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/iisfaq/32/9211_2.png) [@iisfaq](https://forums.plex.tv/u/iisfaq)\
**Post date:** [January 14, 2014, 9:11pm UTC](https://forums.plex.tv/t/creating-a-scanner-logging-messages-windows/54126/1 "2014-01-14T21:11:27Z")

</div>

I am trying to create a simple scanner and I have used the default TV Series scanner as a starting template, basically stripping most of the code out.

&nbsp;

In there it has a few print statements such as

&nbsp;

&nbsp;print "Hello, world!"

&nbsp;

Can you see this output anywhere?

&nbsp;

Also the docs refer to a Log.Debug, Log.Info etc

&nbsp;

If I try to use this method I get an exception in the main scanner log.

&nbsp;

Jan 15, 2014 10:09:09:279 [1412] ERROR - Error in Python: Running scanner:

Traceback (most recent call last):

&nbsp; File "C:\Users\ccrowe.AP\AppData\Local\Plex Media Server\Plug-ins\Scanners.bundle\Contents\Resources\Series\Chris Training Scanner.py", line 22, in Scan

&nbsp; &nbsp; Log.Debug( "Found File : %s" % file)

NameError: global name 'Log' is not defined

&nbsp;

What do I need to do to reference this Log method?

&nbsp;

Chris

&nbsp;

---

<div class="post-metadata">

**Author:** ![mmccurdy](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/mmccurdy/32/83290_2.png) [@mmccurdy](https://forums.plex.tv/u/mmccurdy)\
**Post date:** [January 14, 2014, 9:34pm UTC](https://forums.plex.tv/t/creating-a-scanner-logging-messages-windows/54126/2 "2014-01-14T21:34:58Z")

</div>

The Scanner doesn't run in the Framework, so "Log()" and other Framework functions won't work there.

You can run the scanner executable at the command line and use normal "print" statements to debug.

---

<div class="post-metadata">

**Author:** ![iisfaq](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/iisfaq/32/9211_2.png) [@iisfaq](https://forums.plex.tv/u/iisfaq)\
**Post date:** [January 14, 2014, 9:38pm UTC](https://forums.plex.tv/t/creating-a-scanner-logging-messages-windows/54126/3 "2014-01-14T21:38:19Z")

</div>

Thanks - just what I needed...

Chris

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [December 21, 2019, 1:02am UTC](https://forums.plex.tv/t/creating-a-scanner-logging-messages-windows/54126/4 "2019-12-21T01:02:16Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
