| 70 | } |
| 71 | |
| 72 | inline void WriteData(const TLogRecord& rec) { |
| 73 | THolder<TRec> obj(new (rec.Len) TRec(this, rec)); |
| 74 | |
| 75 | if (Queue_.Add(obj.Get())) { |
| 76 | Y_UNUSED(obj.Release()); |
| 77 | return; |
| 78 | } |
| 79 | |
| 80 | if (QueueOverflowCallback_) { |
| 81 | QueueOverflowCallback_(); |
| 82 | } else { |
| 83 | ythrow yexception() << "log queue exhausted"; |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | // Write an emergency message when the memory allocator is corrupted. |
| 88 | // The TThreadedLogBackend object can't be used after this method is called. |