return o zero call costs

This commit is contained in:
Radu Ioan Fericean
2012-07-31 14:51:59 +03:00
parent 2ceb330703
commit eed45bdb0e
4 changed files with 9 additions and 1 deletions

View File

@@ -36,6 +36,10 @@ func (psl *PostgresLogger) Close() {
}
func (psl *PostgresLogger) Log(uuid string, cc *timespans.CallCost) {
if psl.db == nil {
timespans.Logger.Warning("Cannot write log to database.")
return
}
tss, err := json.Marshal(cc.Timespans)
if err != nil {
log.Printf("Error marshalling timespans to json: %v", err)