# Log statement causes error

**URL:** <https://forums.plex.tv/t/log-statement-causes-error/13635>\
**Category:** Dev/API Corner\
**Tags:** plugin-dev\
**Created:** [December 28, 2011, 5:15pm UTC](https://forums.plex.tv/t/log-statement-causes-error/13635 "2011-12-28T17:15:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![imyrvold](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/imyrvold/32/387_2.png) [@imyrvold](https://forums.plex.tv/u/imyrvold)\
**Post date:** [December 28, 2011, 5:15pm UTC](https://forums.plex.tv/t/log-statement-causes-error/13635/1 "2011-12-28T17:15:29Z")

</div>

I am developing a channel plugin for [www.memocast.com](http://www.memocast.com). I want to print some debug information, and I see from other code examples that they use a Log statement, like  
  
Log(“This is a log”)  
  
and I assuem that this prints the log text to the Plex log file.  
  
But whenever I try to use it in my code, I always get error. What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![jam](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/jam/32/186050_2.png) [@jam](https://forums.plex.tv/u/jam)\
**Post date:** [December 28, 2011, 5:31pm UTC](https://forums.plex.tv/t/log-statement-causes-error/13635/2 "2011-12-28T17:31:39Z")

</div>

That should work fine. What’s the error? 🙂

---

<div class="post-metadata">

**Author:** ![imyrvold](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/imyrvold/32/387_2.png) [@imyrvold](https://forums.plex.tv/u/imyrvold)\
**Post date:** [December 28, 2011, 9:34pm UTC](https://forums.plex.tv/t/log-statement-causes-error/13635/3 "2011-12-28T21:34:14Z")

</div>

When I add the Log statement, and move the bundle to Plug-ins folder:  
  
  
  
Dec 28, 2011 22:30:53 [0xb3a65000] DEBUG - Starting plug-in /Users/imyrvold/Library/Application Support/Plex Media Server/Plug-ins/Memocast.bundle.  
  
Dec 28, 2011 22:30:53 [0xb3a65000] DEBUG - Removing directory for site configurations: /Users/imyrvold/Library/Application Support/Plex Media Server/Plug-ins/Memocast.bundle/Contents/Site Configurations  
  
Dec 28, 2011 22:30:53 [0xb3a65000] DEBUG - Starting file watcher for com.plexapp.plugins.memocast  
  
Dec 28, 2011 22:30:53 [0xb3a65000] DEBUG - Spawned plug-in com.plexapp.plugins.memocast with PID 7155  
  
Dec 28, 2011 22:30:53 [0xb3a65000] DEBUG - [com.plexapp.plugins.memocast] Sent command: GET /:/prefixes  
  
Dec 28, 2011 22:30:54 [0xb0cb1000] DEBUG - Request: GET /system/messaging/clear\_events/com.plexapp.plugins.memocast [127.0.0.1] (2 live)  
  
Dec 28, 2011 22:30:54 [0xb0cb1000] DEBUG - [com.plexapp.system] Sending command over HTTP (GET): /system/messaging/clear\_events/com.plexapp.plugins.memocast  
  
Dec 28, 2011 22:30:54 [0xb0cb1000] DEBUG - HTTP request to: [http://127.0.0.1:57368/system/messaging/clear\_events/com.plexapp.plugins.memocast](http://127.0.0.1:57368/system/messaging/clear_events/com.plexapp.plugins.memocast)  
  
Dec 28, 2011 22:30:54 [0xb3a65000] ERROR - Error reading from plug-in [com.plexapp.plugins.memocast], we’re killing it (got: ‘’).  
  
Dec 28, 2011 22:30:54 [0xb3a65000] DEBUG - Stopping [com.plexapp.plugins.memocast].  
  
Dec 28, 2011 22:30:54 [0xb3a65000] DEBUG - [com.plexapp.plugins.memocast] Killing.  
  
Dec 28, 2011 22:30:54 [0xb3a65000] ERROR - Error received reading configuration for com.plexapp.plugins.memocast  
  
Dec 28, 2011 22:30:54 [0xb3a65000] DEBUG - Stopping [com.plexapp.plugins.memocast].  
  
  
  
When I remove the Log line:  
  
  
  
Dec 28, 2011 22:33:04 [0xb3beb000] DEBUG - File /Users/imyrvold/Library/Application Support/Plex Media Server/Plug-ins/Memocast.bundle/Contents/Code changed: 1325107847 =\> 1325107983.  
  
Dec 28, 2011 22:33:04 [0xb3beb000] DEBUG - File /Users/imyrvold/Library/Application Support/Plex Media Server/Plug-ins/Memocast.bundle/Contents/Code/ **init**.py changed: 1325107847 =\> 1325107983.  
  
Dec 28, 2011 22:33:04 [0xb3beb000] DEBUG - Changed: /Users/imyrvold/Library/Application Support/Plex Media Server/Plug-ins/Memocast.bundle/Contents/Code  
  
Dec 28, 2011 22:33:04 [0xb3beb000] DEBUG - Changed: /Users/imyrvold/Library/Application Support/Plex Media Server/Plug-ins/Memocast.bundle/Contents/Code/ **init**.py

---

<div class="post-metadata">

**Author:** ![jam](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/jam/32/186050_2.png) [@jam](https://forums.plex.tv/u/jam)\
**Post date:** [December 28, 2011, 10:00pm UTC](https://forums.plex.tv/t/log-statement-causes-error/13635/4 "2011-12-28T22:00:05Z")

</div>

What does the plug-in’s log file say? It sounds like a syntax error - that’s the only thing that would prevent the plug-in starting at all.

---

<div class="post-metadata">

**Author:** ![imyrvold](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/imyrvold/32/387_2.png) [@imyrvold](https://forums.plex.tv/u/imyrvold)\
**Post date:** [December 29, 2011, 1:11pm UTC](https://forums.plex.tv/t/log-statement-causes-error/13635/5 "2011-12-29T13:11:32Z")

</div>

Oh, I didn’t know the plug-in had it’s own logfile. It became evident what was wrong once I had a look there. It was simple an indentation error. i have never used python before, so that was a new experience.  
  
Now I got one step further creating the plugin 🙂

---

<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 20, 2019, 9:33pm UTC](https://forums.plex.tv/t/log-statement-causes-error/13635/6 "2019-12-20T21:33:15Z")

</div>

Closed on December 20, 2019, 9:33pm UTC

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