public ContinuesBinaryFileLogger(IStreamProvider streamProvider, ISubmitLogEntryFactory submitLogEntryFactory, IBufferAllocatorFactory bufferAllocatorFactory)
        {
            m_listWriter = new ExpendableListWriter(streamProvider, OnNewfileCreated);
            m_logEntry = submitLogEntryFactory.CreateSubmitLogEntry(m_listWriter);
            var stringCache = submitLogEntryFactory.CreateSubmitLogEntry(m_listWriter);
            var definition = submitLogEntryFactory.CreateSubmitLogEntry(m_listWriter);

            m_binaryLogSerilizer = new BinaryLogSerilizer(new BinaryLogSerilizer.BufferAndSubmiterTuple(m_logEntry, bufferAllocatorFactory.CreateBufferAllocator()),
                                            new BinaryLogSerilizer.BufferAndSubmiterTuple(stringCache, bufferAllocatorFactory.CreateBufferAllocator()),
                                            new BinaryLogSerilizer.BufferAndSubmiterTuple(definition, bufferAllocatorFactory.CreateBufferAllocator()));
        }
        public BinaryLogSerilizer(BufferAndSubmiterTuple logentry,BufferAndSubmiterTuple definitions, BufferAndSubmiterTuple stringCache)
        {
            m_logEntrySubmiter = logentry.SubmitLogEntry;
            m_logEntryBufferAllocator = logentry.BufferAllocator;
            m_stringCacheBufferAllocator = stringCache.BufferAllocator;
            m_stringCacheSubmiter = stringCache.SubmitLogEntry;
            m_definitionBufferAllocator = definitions.BufferAllocator;
            m_definitionSubmiter = definitions.SubmitLogEntry;

            m_streamLogBinaryPackager = new StreamLogBinaryPackager();
            m_streamLogBinaryPackager.StringChached += OnStringChached;
            m_streamLogBinaryPackager.PackageRegistered += OnPackageRegistered;

            m_streamLogBinaryPackager.RegisterDefinition(new LogEntryPackageDefinition());
            m_streamLogBinaryPackager.RegisterDefinition(new StringLogTitlePackageDefinition());
            m_streamLogBinaryPackager.RegisterDefinition(new CustomStringLogTitlePackageDefinition());
            m_streamLogBinaryPackager.RegisterDefinition(new OpenLogScopeTitlePackageDefinition());
            m_streamLogBinaryPackager.RegisterDefinition(new PackageDefinition<CloseLogScopeTitle>());
            m_streamLogBinaryPackager.RegisterDefinition(new StringCachePackageDefinition());

            m_streamLogBinaryPackager.RegisterDefinition(new ObjectPackageDefinition());
        }
 public BufferAndSubmiterTuple(ISubmitEntry<IRawData> entry,IBufferAllocator bufferAllocator)
 {
     SubmitLogEntry = entry;
     BufferAllocator = bufferAllocator;
 }