Browse files

1.5.13

log to same directory as the debug.log by default
allow the pmsencoder.log directory to be overridden by 1) system property or 2) PMS.conf option
  • Loading branch information...
1 parent 2289f4f commit 0c9a97dce062e4a6234960fbba57a6a5681e93a9 @chocolateboy committed Mar 25, 2012
View
4 Changes
@@ -1,3 +1,7 @@
+1.5.13 Sun Mar 25 02:15:33 2012
+ - log to same directory as the debug.log by default
+ - allow the pmsencoder.log directory to be overridden by 1) system property or 2) PMS.conf option
+
1.5.12 Sun Jan 29 06:21:46 2012
- YouTube fix
View
6 README.md
@@ -10,7 +10,7 @@ These instructions assume you have the [latest version](http://www.ps3mediaserve
# Installation <a name="Install"></a>
-* download the [PMSEncoder jar file](https://github.com/downloads/chocolateboy/pmsencoder/pmsencoder-1.5.12.jar) and place it in the PMS `plugins` directory
+* download the [PMSEncoder jar file](https://github.com/downloads/chocolateboy/pmsencoder/pmsencoder-1.5.13.jar) and place it in the PMS `plugins` directory
* shut down PMS; open `PMS.conf` in a text editor; and add `pmsencoder` to the front of the list of engines e.g.
* `engines = pmsencoder,mencoder,tsmuxer,mplayeraudio` &c.
* restart PMS
@@ -20,7 +20,7 @@ These instructions assume you have the [latest version](http://www.ps3mediaserve
To upgrade to a new version of the plugin:
* check the [release notes](https://github.com/chocolateboy/pmsencoder/wiki/Release-Notes) to see if there any breaking changes or other incompatibilities
-* replace the old jar file in the `plugins` directory with the [new version](https://github.com/downloads/chocolateboy/pmsencoder/pmsencoder-1.5.12.jar) and restart PMS
+* replace the old jar file in the `plugins` directory with the [new version](https://github.com/downloads/chocolateboy/pmsencoder/pmsencoder-1.5.13.jar) and restart PMS
## Uninstalling <a name="Uninstall"></a>
@@ -68,7 +68,7 @@ For more details, discussion and troubleshooting tips, see the [wiki](http://wik
# Version <a name="Version"></a>
-1.5.12
+1.5.13
# License <a name="License"></a>
View
12 pom.xml
@@ -4,15 +4,15 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.chocolatey.pmsencoder</groupId>
<artifactId>pmsencoder</artifactId>
- <version>1.5.12</version>
+ <version>1.5.13</version>
<name>PMSEncoder</name>
<description>A plugin for PS3 Media Server that adds support for scriptable web video streaming.</description>
<properties>
<groovypp-repo>http://groovypp.artifactoryonline.com/groovypp</groovypp-repo>
<groovypp-version>0.9.0_1.7.10</groovypp-version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<junit-version>4.9</junit-version>
- <pms-version>1.50.1</pms-version>
+ <pms-version>1.52.0</pms-version>
<regexplus-version>2010-04-16</regexplus-version>
</properties>
@@ -221,7 +221,7 @@
<plugin>
<groupId>com.savage7.maven.plugins</groupId>
<artifactId>maven-external-dependency-plugin</artifactId>
- <version>0.5-SNAPSHOT</version>
+ <version>0.5</version>
<executions>
<execution>
<id>clean-external-dependencies</id>
@@ -264,9 +264,9 @@
<downloadUrl>https://ps3mediaserver.googlecode.com/files/pms-generic-linux-unix-${pms-version}.tgz</downloadUrl>
<install>true</install>
<force>false</force>
- <checksum>9def50c8757802ad76e927dc729d2abcb8dd650f</checksum>
- <extractFile>pms-linux-${pms-version}/pms.jar</extractFile>
- <extractFileChecksum>ebefe2346aad2316e36874674d1a60d9270efe68</extractFileChecksum>
+ <checksum>b19898112d4df1af27df5aa9d01d3b67af026e94</checksum>
+ <extractFile>pms-${pms-version}/pms.jar</extractFile>
+ <extractFileChecksum>9f8eb8bba03b9ffe0e28210060cf94b49188ded7</extractFileChecksum>
</artifactItem>
</artifactItems>
</configuration>
View
7 src/main/groovy/com/chocolatey/pmsencoder/PMSEncoderProcessWrapper.java
@@ -40,9 +40,9 @@ finished rather than after (!). This finally means one can see the error
private boolean success;
@Override
- public String toString() {
- return super.getName();
- }
+ public String toString() {
+ return super.getName();
+ }
public boolean isSuccess() {
return success;
@@ -77,6 +77,7 @@ public void attachProcess(ProcessWrapper process) {
public void run() {
ProcessBuilder pb = new ProcessBuilder(cmdArray);
+
try {
PMS.info("Starting " + cmdLine);
View
29 src/main/groovy/com/chocolatey/pmsencoder/Plugin.groovy
@@ -13,8 +13,10 @@ import net.pms.configuration.PmsConfiguration
import net.pms.dlna.DLNAMediaInfo
import net.pms.dlna.DLNAResource
import net.pms.encoders.Player
+import net.pms.encoders.PlayerFactory
import net.pms.external.ExternalListener
import net.pms.formats.Format
+import net.pms.logging.DebugLogPathDefiner
import net.pms.PMS
import no.geosoft.cc.io.FileListener
@@ -23,9 +25,10 @@ import no.geosoft.cc.io.FileMonitor
import org.apache.log4j.xml.DOMConfigurator
public class Plugin implements ExternalListener, FileListener {
- private static final String VERSION = '1.5.12'
+ private static final String VERSION = '1.5.13'
private static final String DEFAULT_SCRIPT_DIRECTORY = 'pmsencoder'
private static final String LOG_CONFIG = 'pmsencoder.log.config'
+ private static final String LOG_DIRECTORY = 'pmsencoder.log.directory'
private static final String SCRIPT_DIRECTORY = 'pmsencoder.script.directory'
private static final String SCRIPT_POLL = 'pmsencoder.script.poll'
// 1 second is flaky - it results in overlapping file change events
@@ -47,6 +50,7 @@ public class Plugin implements ExternalListener, FileListener {
// get optional overrides from PMS.conf
String customLogConfigPath = configuration.getCustomProperty(LOG_CONFIG)
+ String customLogDirectory = configuration.getCustomProperty(LOG_DIRECTORY)
String candidateScriptDirectory = configuration.getCustomProperty(SCRIPT_DIRECTORY)
/*
@@ -98,6 +102,17 @@ public class Plugin implements ExternalListener, FileListener {
}
// set up log4j
+
+ // set the log path as a system property so that it can be used in log4j_default.xml
+ // 1) system property
+ // 2) PMS.conf option
+ // 3) same directory as the debug.log
+ if (!System.getProperty(LOG_DIRECTORY)) {
+ System.setProperty(LOG_DIRECTORY, customLogDirectory ?: (new DebugLogPathDefiner()).getPropertyValue())
+ }
+
+ info("log directory: " + System.getProperty(LOG_DIRECTORY))
+
def customLogConfig
if (customLogConfigPath) {
@@ -138,7 +153,7 @@ public class Plugin implements ExternalListener, FileListener {
* */
def extensions = pms.getExtensions()
extensions.set(0, new WEB())
- registerPlayer(pmsencoder)
+ PlayerFactory.registerPlayer(pmsencoder)
}
private void loadDefaultLogConfig() {
@@ -197,16 +212,6 @@ public class Plugin implements ExternalListener, FileListener {
}
}
- private void registerPlayer(PMSEncoder pmsencoder) {
- try {
- def pmsRegisterPlayer = pms.getClass().getDeclaredMethod('registerPlayer', Player.class)
- pmsRegisterPlayer.setAccessible(true)
- pmsRegisterPlayer.invoke(pms, pmsencoder)
- } catch (Exception e) {
- error('error calling PMS.registerPlayer', e)
- }
- }
-
public boolean match(Command command) {
matcher.match(command)
}
View
2 src/main/resources/log4j_default.xml
@@ -10,7 +10,7 @@
</appender>
<appender name="logfile" class="org.apache.log4j.RollingFileAppender">
- <param name="File" value="pmsencoder.log"/>
+ <param name="File" value="${pmsencoder.log.directory}${file.separator}pmsencoder.log"/>
<param name="Append" value="false" />
<param name="MaxFileSize" value="1MB"/>
<param name="MaxBackupIndex" value="2"/>
View
2 src/test/groovy/PMSEncoderTestCase.groovy
@@ -37,7 +37,7 @@ abstract class PMSEncoderTestCase extends GroovyTestCase {
public boolean init () { true }
@Mock
- public static void minimal(String msg) {
+ public static void info(String msg) {
println msg
}

0 comments on commit 0c9a97d

Please sign in to comment.