func (manager *LoggerManager) SendBulk(SyncTime bool) bool {
    if SyncTime {
        manager.UpdateTimeDeltaInterval()
    }

    BufferSizeToSend := manager.LogsBufferSize()
    if BufferSizeToSend < 1 {
        DebugLogger.Println("Buffer is empty, there is nothing to send!")
        return false
    }

    for manager.LogsBufferLength() > MaxLogChunkSize && BufferSizeToSend > 1 {
        BufferSizeToSend = int(BufferSizeToSend / 2)
    }

    if BufferSizeToSend < 1 {
        BufferSizeToSend = 1
    }

    DebugLogger.Println("Checking buffer size. Total log entries is:", BufferSizeToSend)
    LogsBulk := NewBulk(manager.Credentials)
    for _, Record := range manager.LogsBuffer[:BufferSizeToSend] {
        LogsBulk.AddRecord(Record)
    }
    manager.LogsBuffer = manager.LogsBuffer[BufferSizeToSend:]
    SendRequest(LogsBulk)
    return true
}
// SendBulk send logs bulk to Coralogix
SendBulk send logs bulk to Coralogix
// SendBulk send logs bulk to Coralogix
func (manager *LoggerManager) SendBulk(SyncTime bool) bool {
    if SyncTime {
        manager.UpdateTimeDeltaInterval()
    }
    BufferSizeToSend := manager.LogsBufferSize()
    if BufferSizeToSend < 1 {
        DebugLogger.Println("Buffer is empty, there is nothing to send!")
        return false
    }
    for manager.LogsBufferLength() > MaxLogChunkSize && BufferSizeToSend > 1 {
        BufferSizeToSend = int(BufferSizeToSend / 2)
    }
    if BufferSizeToSend < 1 {
        BufferSizeToSend = 1
    }
    DebugLogger.Println("Checking buffer size. Total log entries is:", BufferSizeToSend)
    LogsBulk := NewBulk(manager.Credentials)
    for _, Record := range manager.LogsBuffer[:BufferSizeToSend] {
        LogsBulk.AddRecord(Record)
    }
    manager.LogsBuffer = manager.LogsBuffer[BufferSizeToSend:]
    SendRequest(LogsBulk)
    return true
}
func ( manager * LoggerManager ) SendBulk ( SyncTime bool ) bool { if SyncTime { manager . UpdateTimeDeltaInterval ( ) } BufferSizeToSend := manager . LogsBufferSize ( ) if BufferSizeToSend < 1 { DebugLogger . Println ( " " ) return false } for manager . LogsBufferLength ( ) > MaxLogChunkSize && BufferSizeToSend > 1 { BufferSizeToSend = int ( BufferSizeToSend / 2 ) } if BufferSizeToSend < 1 { BufferSizeToSend = 1 } DebugLogger . Println ( " " , BufferSizeToSend ) LogsBulk := NewBulk ( manager . Credentials ) for _ , Record := range manager . LogsBuffer [ : BufferSizeToSend ] { LogsBulk . AddRecord ( Record ) } manager . LogsBuffer = manager . LogsBuffer [ BufferSizeToSend : ] SendRequest ( LogsBulk ) return true }
SendBulk send logs bulk to Coralogix
SendBulk send logs bulk to Coralogix