Endjin.Assembly.ChangeDetection.Infrastructure.TraceCfgParser.OpenOutputDevice C# (CSharp) Method

OpenOutputDevice() private method

private OpenOutputDevice ( string outDevice ) : void
outDevice string
return void
        private void OpenOutputDevice(string outDevice)
        {
            var parts = outDevice.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);

            var deviceName = parts[0];
            var deviceConfig = string.Join(" ", parts.Skip(1).ToArray());

            switch (deviceName)
            {
                case "file":
                    if (deviceConfig == "")
                    {
                        deviceConfig = DefaultTraceFileBaseName;
                    }
                    this.OutDevice = new TextWriterTraceListener(CreateTraceFile(deviceConfig));
                    break;

                case "debugoutput":
                    this.OutDevice = new DefaultTraceListener();
                    break;

                case "console":
                    this.OutDevice = new ConsoleTraceListener();
                    break;
                case "null":
                    this.OutDevice = new NullTraceListener();
                    break;

                case "default":
                    this.UseAppConfigListeners = true;
                    this.OutDevice = new NullTraceListener();
                    break;

                default:
                    InternalError.Print("The trace output device {0} is not supported.", outDevice);
                    this.bHasError = true;
                    break;
            }
        }