[
https://issues.apache.org/jira/browse/LOG4PHP-62?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12735755#action_12735755
]
Christian Hammers commented on LOG4PHP-62:
------------------------------------------
And now that the unit tests work, here is the necessary patch for the newly
introduced exception:
Index: src/test/php/configurators/LoggerConfiguratorIniTest.php
===================================================================
--- src/test/php/configurators/LoggerConfiguratorIniTest.php (Revision
798271)
+++ src/test/php/configurators/LoggerConfiguratorIniTest.php (Arbeitskopie)
@@ -65,7 +65,13 @@
}
public function testConfigureWithoutIniFile() {
- self::assertFalse(LoggerConfiguratorIni::configure());
+ $catchedException = null;
+ try {
+ LoggerConfiguratorIni::configure();
+ } catch (Exception $e) {
+ $catchedException = $e;
+ }
+ self::assertNotNull($catchedException);
}
public function testConfigureWithEmptyIniFile() {
> Does not print warning if ini file is corrupt
> ---------------------------------------------
>
> Key: LOG4PHP-62
> URL: https://issues.apache.org/jira/browse/LOG4PHP-62
> Project: Log4php
> Issue Type: Bug
> Components: Code
> Affects Versions: 2.0
> Reporter: Christian Hammers
> Fix For: 2.0
>
> Attachments: WarnIfIniHasErrors.diff
>
>
> *Grmpf*! There was a simple typo in the ini file and log4php did ... nothing!
> Not even tell me that there was an error or even where exactly! It took me
> quite some time to debug that. How I hate such software...
> I understand that a logging framework tries to be as non-disruptive as
> possible and we can argue about whether it should throw an exception just
> because the database server, it tries to log, to is suddenly (temporarily)
> unavailable but as parsing the ini file happens at the very first of most
> applications I'm totally in favour of throwing an exception here!
> Please find a patch attached. It will cause the output to look like:
> $ php testPDO.php
> Exception: LoggerConfiguratorIni: Error parsing testPDO.properties on line 7
> in
> /srv/home/james/workspace/log4php/src/main/php/configurators/LoggerConfiguratorIni.php
> on line 307
> bye,
> -christian-
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.