Exemplo n.º 1
0
        public override string ToString()
        {
            string paramsStr = ConnectionParams.ToString();

            return(string.Format("<{0}\\{1}>{2}{3}",
                                 Factory.CompanyName, Factory.FormatName, string.IsNullOrEmpty(paramsStr) ? "" : " ", paramsStr));
        }
Exemplo n.º 2
0
        public StreamLogProvider(
            ILogProviderHost host,
            ILogProviderFactory factory,
            IConnectionParams connectParams,
            StreamBasedFormatInfo formatInfo,
            Type readerType
            ) :
            base(host, factory, connectParams)
        {
            using (tracer.NewFrame)
            {
                tracer.Info("readerType={0}", readerType);

                if (connectionParams[ConnectionParamsKeys.RotatedLogFolderPathConnectionParam] != null)
                {
                    media = new RollingFilesMedia(
                        LogMedia.FileSystemImpl.Instance,
                        readerType,
                        formatInfo,
                        tracer,
                        new GenericRollingMediaStrategy(connectionParams[ConnectionParamsKeys.RotatedLogFolderPathConnectionParam]),
                        host.TempFilesManager,
                        host.TraceSourceFactory
                        );
                }
                else
                {
                    media = new SimpleFileMedia(connectParams);
                }

                reader = (IPositionedMessagesReader)Activator.CreateInstance(
                    readerType, new MediaBasedReaderParams(this.threads, media, host.TempFilesManager, host.TraceSourceFactory,
                                                           settingsAccessor: host.GlobalSettings, parentLoggingPrefix: tracer.Prefix), formatInfo);

                ITimeOffsets initialTimeOffset;
                if (LogJoint.TimeOffsets.TryParse(
                        connectionParams[ConnectionParamsKeys.TimeOffsetConnectionParam] ?? "", out initialTimeOffset))
                {
                    reader.TimeOffsets = initialTimeOffset;
                }

                StartAsyncReader("Reader thread: " + connectParams.ToString(), reader);

                InitPathDependentMembers(connectParams);
            }
        }
Exemplo n.º 3
0
        public StreamLogProvider(
            ILogProviderHost host,
            ILogProviderFactory factory,
            IConnectionParams connectParams,
            Func <MediaBasedReaderParams, IPositionedMessagesReader> readerCreator
            ) :
            base(host, factory, connectParams)
        {
            using (tracer.NewFrame)
            {
                if (connectionParams[ConnectionParamsKeys.RotatedLogFolderPathConnectionParam] != null)
                {
                    media = new RollingFilesMedia(
                        LogMedia.FileSystemImpl.Instance,
                        readerCreator,
                        tracer,
                        new GenericRollingMediaStrategy(connectionParams[ConnectionParamsKeys.RotatedLogFolderPathConnectionParam])
                        );
                }
                else
                {
                    media = new SimpleFileMedia(connectParams);
                }

                reader = readerCreator(new MediaBasedReaderParams(this.threads, media,
                                                                  settingsAccessor: host.GlobalSettings, parentLoggingPrefix: tracer.Prefix));

                ITimeOffsets initialTimeOffset;
                if (LogJoint.TimeOffsets.TryParse(
                        connectionParams[ConnectionParamsKeys.TimeOffsetConnectionParam] ?? "", out initialTimeOffset))
                {
                    reader.TimeOffsets = initialTimeOffset;
                }

                StartAsyncReader("Reader thread: " + connectParams.ToString(), reader);

                InitPathDependentMembers(connectParams);
            }
        }
Exemplo n.º 4
0
 public override string ToString()
 {
     return(underlyingParams.ToString());
 }