diff --git a/db/zm_create.sql.in b/db/zm_create.sql.in index 8e2ee8a11..a627070d2 100644 --- a/db/zm_create.sql.in +++ b/db/zm_create.sql.in @@ -337,21 +337,13 @@ CREATE TABLE `Monitors` ( `Format` int(10) unsigned NOT NULL default '0', `V4LMultiBuffer` tinyint(1) unsigned, `V4LCapturesPerFrame` tinyint(3) unsigned, -<<<<<<< HEAD `Protocol` varchar(16), -======= - `Protocol` varchar(16) default '', ->>>>>>> montagereview_rework `Method` varchar(16) NOT NULL default '', `Host` varchar(64), `Port` varchar(8) NOT NULL default '', `SubPath` varchar(64) NOT NULL default '', `Path` varchar(255), -<<<<<<< HEAD `Options` varchar(255), -======= - `Options` varchar(255) default '', ->>>>>>> montagereview_rework `User` varchar(64), `Pass` varchar(64), `Width` smallint(5) unsigned NOT NULL default '0', diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm b/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm index 3f30672ee..b803ef329 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm @@ -297,24 +297,28 @@ sub terminate { sub reinitialise { my $this = shift; + # So if the logger is initialized, we just return. Since the logger is NORMALLY initialized... the rest of this function never executes. return unless ( $this->{initialised} ); # Bit of a nasty hack to reopen connections to log files and the DB my $syslogLevel = $this->syslogLevel(); $this->syslogLevel( NOLOG ); + $this->syslogLevel( $syslogLevel ) if ( $syslogLevel > NOLOG ); + my $logfileLevel = $this->fileLevel(); $this->fileLevel( NOLOG ); + $this->fileLevel( $logfileLevel ) if ( $logfileLevel > NOLOG ); + my $databaseLevel = $this->databaseLevel(); $this->databaseLevel( NOLOG ); + $this->databaseLevel( $databaseLevel ) if ( $databaseLevel > NOLOG ); + my $screenLevel = $this->termLevel(); $this->termLevel( NOLOG ); - - $this->syslogLevel( $syslogLevel ) if ( $syslogLevel > NOLOG ); - $this->fileLevel( $logfileLevel ) if ( $logfileLevel > NOLOG ); - $this->databaseLevel( $databaseLevel ) if ( $databaseLevel > NOLOG ); - $this->databaseLevel( $databaseLevel ) if ( $databaseLevel > NOLOG ); + $this->termLevel( $screenLevel ) if ( $screenLevel > NOLOG ); } +# Prevents undefined logging levels sub limit { my $this = shift; my $level = shift; @@ -375,12 +379,16 @@ sub level { my $level = shift; if ( defined($level) ) { $this->{level} = $this->limit( $level ); + + # effectiveLevel is the highest logging level used by any of the outputs. $this->{effectiveLevel} = NOLOG; $this->{effectiveLevel} = $this->{termLevel} if ( $this->{termLevel} > $this->{effectiveLevel} ); $this->{effectiveLevel} = $this->{databaseLevel} if ( $this->{databaseLevel} > $this->{effectiveLevel} ); $this->{effectiveLevel} = $this->{fileLevel} if ( $this->{fileLevel} > $this->{effectiveLevel} ); $this->{effectiveLevel} = $this->{syslogLevel} if ( $this->{syslogLevel} > $this->{effectiveLevel} ); - $this->{effectiveLevel} = $this->{level} if ( $this->{effectiveLevel} > $this->{effectiveLevel} ); + + # ICON: I am remarking this out because I don't see the point of having an effective level, if we are just going to set it to level. + #$this->{effectiveLevel} = $this->{level} if ( $this->{level} > $this->{effectiveLevel} ); } return( $this->{level} ); } @@ -400,6 +408,7 @@ sub termLevel { my $this = shift; my $termLevel = shift; if ( defined($termLevel) ) { + # What is the point of this next lint if we are just going to overwrite it with the next line? I propose we move it down one line or remove it altogether $termLevel = NOLOG if ( !$this->{hasTerm} ); $termLevel = $this->limit( $termLevel ); if ( $this->{termLevel} != $termLevel ) {