Make bad logs findable

This commit is contained in:
dave 2017-11-09 18:18:46 -08:00
parent ce34de2910
commit 61c2a8cc79
3 changed files with 11 additions and 4 deletions

4
.gitignore vendored
View File

@ -5,4 +5,8 @@ __pycache__
/python/irclogtools.egg-info/
/tmp/
/debian/irclogtools
/debian/debhelper-build-stamp
/debian/files
/debian/irclogtools.debhelper.log
/debian/irclogtools.substvars
/ilogarchive

View File

@ -1,3 +1,6 @@
#!/bin/sh
dpkg-buildpackage -us -uc -b
mv ../irclogtools_1.0.0-1_a* ./
rm *.changes

View File

@ -247,14 +247,14 @@ func (self *CombinedLogfile) AddPortion(newportion LogPortion) {
if self.Channel == "" {
self.Channel = newportion.meta.Channel // TODO set attr on all children
} else if newportion.meta.Channel != "" && self.Channel != newportion.meta.Channel {
panic(fmt.Sprintf("Attempted to add portion with channel '%s' to archive with channel '%s'",
newportion.meta.Channel, self.Channel))
panic(fmt.Sprintf("Attempted to add portion with channel '%s' to archive with channel '%s'. Log: %s",
newportion.meta.Channel, self.Channel, newportion.meta.Name))
}
if self.Network == "" {
self.Network = newportion.meta.Network // TODO set attr on all children
} else if newportion.meta.Network != "" && self.Network != newportion.meta.Network {
panic(fmt.Sprintf("Attempted to add portion with network '%s' to archive with network '%s'",
newportion.meta.Network, self.Network))
panic(fmt.Sprintf("Attempted to add portion with network '%s' to archive with network '%s'. Log: %s",
newportion.meta.Network, self.Network, newportion.meta.Name))
}
// Remove any portions with identical date
for i, portion := range self.portions {