@@ -19,6 +19,7 @@ import (
19
19
"github.com/go-mysql-org/go-mysql/schema"
20
20
"github.com/pingcap/errors"
21
21
"github.com/pingcap/parser"
22
+ "github.com/siddontang/go-log/log"
22
23
)
23
24
24
25
// Canal can sync your MySQL data into everywhere, like Elasticsearch, Redis, etc...
@@ -221,12 +222,14 @@ func (c *Canal) run() error {
221
222
close (c .dumpDoneCh )
222
223
223
224
if err != nil {
225
+ log .Errorf ("canal dump mysql err: %v" , err )
224
226
return errors .Trace (err )
225
227
}
226
228
}
227
229
228
230
if err := c .runSyncBinlog (); err != nil {
229
231
if errors .Cause (err ) != context .Canceled {
232
+ log .Errorf ("canal start sync binlog err: %v" , err )
230
233
return errors .Trace (err )
231
234
}
232
235
}
@@ -235,7 +238,7 @@ func (c *Canal) run() error {
235
238
}
236
239
237
240
func (c * Canal ) Close () {
238
- c . cfg . Logger .Infof ("closing canal" )
241
+ log .Infof ("closing canal" )
239
242
c .m .Lock ()
240
243
defer c .m .Unlock ()
241
244
@@ -349,6 +352,8 @@ func (c *Canal) GetTable(db string, table string) (*schema.Table, error) {
349
352
c .tableLock .Lock ()
350
353
c .errorTablesGetTime [key ] = time .Now ()
351
354
c .tableLock .Unlock ()
355
+ // log error and return ErrMissingTableMeta
356
+ log .Errorf ("canal get table meta err: %v" , errors .Trace (err ))
352
357
return nil , schema .ErrMissingTableMeta
353
358
}
354
359
return nil , err
0 commit comments