Merge branch 'storageareas' of github.com:ConnorTechnology/ZoneMinder into storageareas

This commit is contained in:
Isaac Connor 2017-07-05 15:34:35 -04:00
commit 6d0dad38e0
2 changed files with 15 additions and 14 deletions

View File

@ -337,21 +337,13 @@ CREATE TABLE `Monitors` (
`Format` int(10) unsigned NOT NULL default '0', `Format` int(10) unsigned NOT NULL default '0',
`V4LMultiBuffer` tinyint(1) unsigned, `V4LMultiBuffer` tinyint(1) unsigned,
`V4LCapturesPerFrame` tinyint(3) unsigned, `V4LCapturesPerFrame` tinyint(3) unsigned,
<<<<<<< HEAD
`Protocol` varchar(16), `Protocol` varchar(16),
=======
`Protocol` varchar(16) default '',
>>>>>>> montagereview_rework
`Method` varchar(16) NOT NULL default '', `Method` varchar(16) NOT NULL default '',
`Host` varchar(64), `Host` varchar(64),
`Port` varchar(8) NOT NULL default '', `Port` varchar(8) NOT NULL default '',
`SubPath` varchar(64) NOT NULL default '', `SubPath` varchar(64) NOT NULL default '',
`Path` varchar(255), `Path` varchar(255),
<<<<<<< HEAD
`Options` varchar(255), `Options` varchar(255),
=======
`Options` varchar(255) default '',
>>>>>>> montagereview_rework
`User` varchar(64), `User` varchar(64),
`Pass` varchar(64), `Pass` varchar(64),
`Width` smallint(5) unsigned NOT NULL default '0', `Width` smallint(5) unsigned NOT NULL default '0',

View File

@ -297,24 +297,28 @@ sub terminate {
sub reinitialise { sub reinitialise {
my $this = shift; 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} ); return unless ( $this->{initialised} );
# Bit of a nasty hack to reopen connections to log files and the DB # Bit of a nasty hack to reopen connections to log files and the DB
my $syslogLevel = $this->syslogLevel(); my $syslogLevel = $this->syslogLevel();
$this->syslogLevel( NOLOG ); $this->syslogLevel( NOLOG );
$this->syslogLevel( $syslogLevel ) if ( $syslogLevel > NOLOG );
my $logfileLevel = $this->fileLevel(); my $logfileLevel = $this->fileLevel();
$this->fileLevel( NOLOG ); $this->fileLevel( NOLOG );
$this->fileLevel( $logfileLevel ) if ( $logfileLevel > NOLOG );
my $databaseLevel = $this->databaseLevel(); my $databaseLevel = $this->databaseLevel();
$this->databaseLevel( NOLOG ); $this->databaseLevel( NOLOG );
$this->databaseLevel( $databaseLevel ) if ( $databaseLevel > NOLOG );
my $screenLevel = $this->termLevel(); my $screenLevel = $this->termLevel();
$this->termLevel( NOLOG ); $this->termLevel( NOLOG );
$this->termLevel( $screenLevel ) if ( $screenLevel > 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 );
} }
# Prevents undefined logging levels
sub limit { sub limit {
my $this = shift; my $this = shift;
my $level = shift; my $level = shift;
@ -375,12 +379,16 @@ sub level {
my $level = shift; my $level = shift;
if ( defined($level) ) { if ( defined($level) ) {
$this->{level} = $this->limit( $level ); $this->{level} = $this->limit( $level );
# effectiveLevel is the highest logging level used by any of the outputs.
$this->{effectiveLevel} = NOLOG; $this->{effectiveLevel} = NOLOG;
$this->{effectiveLevel} = $this->{termLevel} if ( $this->{termLevel} > $this->{effectiveLevel} ); $this->{effectiveLevel} = $this->{termLevel} if ( $this->{termLevel} > $this->{effectiveLevel} );
$this->{effectiveLevel} = $this->{databaseLevel} if ( $this->{databaseLevel} > $this->{effectiveLevel} ); $this->{effectiveLevel} = $this->{databaseLevel} if ( $this->{databaseLevel} > $this->{effectiveLevel} );
$this->{effectiveLevel} = $this->{fileLevel} if ( $this->{fileLevel} > $this->{effectiveLevel} ); $this->{effectiveLevel} = $this->{fileLevel} if ( $this->{fileLevel} > $this->{effectiveLevel} );
$this->{effectiveLevel} = $this->{syslogLevel} if ( $this->{syslogLevel} > $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} ); return( $this->{level} );
} }
@ -400,6 +408,7 @@ sub termLevel {
my $this = shift; my $this = shift;
my $termLevel = shift; my $termLevel = shift;
if ( defined($termLevel) ) { 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 = NOLOG if ( !$this->{hasTerm} );
$termLevel = $this->limit( $termLevel ); $termLevel = $this->limit( $termLevel );
if ( $this->{termLevel} != $termLevel ) { if ( $this->{termLevel} != $termLevel ) {