(ent Entry, fields []Field)
| 92 | } |
| 93 | |
| 94 | func (c *ioCore) Write(ent Entry, fields []Field) error { |
| 95 | buf, err := c.enc.EncodeEntry(ent, fields) |
| 96 | if err != nil { |
| 97 | return err |
| 98 | } |
| 99 | _, err = c.out.Write(buf.Bytes()) |
| 100 | buf.Free() |
| 101 | if err != nil { |
| 102 | return err |
| 103 | } |
| 104 | if ent.Level > ErrorLevel { |
| 105 | // Since we may be crashing the program, sync the output. |
| 106 | // Ignore Sync errors, pending a clean solution to issue #370. |
| 107 | _ = c.Sync() |
| 108 | } |
| 109 | return nil |
| 110 | } |
| 111 | |
| 112 | func (c *ioCore) Sync() error { |
| 113 | return c.out.Sync() |
nothing calls this directly
no test coverage detected