当前位置: 首页>>代码示例>>C#>>正文


C# ILogger.LogLine方法代码示例

本文整理汇总了C#中ILogger.LogLine方法的典型用法代码示例。如果您正苦于以下问题:C# ILogger.LogLine方法的具体用法?C# ILogger.LogLine怎么用?C# ILogger.LogLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ILogger的用法示例。


在下文中一共展示了ILogger.LogLine方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FlowEngine

        /// <summary>
        /// Initializes a new instance of the FlowEngine class.
        /// </summary>
        /// <param name="configItems"> The given all configuration items. .</param>
        /// <param name="logFile"> The given file name to store the log. .</param>
        /// <param name="statusRecorder"> The status recorder for the engine. .</param>
        public FlowEngine(Dictionary<string, ConfigurationModule> configItems, string logFile, StatusRecorder statusRecorder)
        {
            if (configItems == null)
            {
                throw new ArgumentNullException("configItems");
            }

            if (string.IsNullOrEmpty(logFile))
            {
                throw new ArgumentNullException("logFile");
            }

            // Initializes the loggers.
            Helper.TestWritable(logFile);
            _detailLogger = new TextLogger(logFile, Encoding.Unicode);
            _compactLogger = new ConsoleLogger();

            if (statusRecorder != null)
            {
                SkipFinishedModules(statusRecorder, configItems);
            }

            // Creates the object to place the items.
            _items = new Dictionary<string, FlowItem>();

            try
            {
                // Setups the pipeline.
                foreach (ConfigurationModule config in configItems.Values)
                {
                    // Creates the item.
                    FlowItem item = new FlowItem(config);
                    item.Handler.StepStatusRecorder = statusRecorder;

                    // Initializes the inputs.
                    item.InitializeInputs(_items);

                    // Updates the implicit inputs.
                    item.UpdateImplictInputs(_items);

                    // Initializes the loggers.
                    item.InitializeLogger(_detailLogger, _compactLogger);

                    // Adds the item into the pipeline.
                    _items.Add(item.Name, item);
                }
            }
            catch (ConfigurationException e)
            {
                Log("Failed to setup the pipeline because of exception - {0}{1}.", Environment.NewLine,
                    Helper.BuildExceptionMessage(e));
                throw;
            }

            Log("All configuration loaded and pipeline is ready.");
            _detailLogger.LogLine("The configuration file can be re-written as:");
            _detailLogger.LogLine("{0}{1}", ToString(), Environment.NewLine);
        }
开发者ID:JohnsonYuan,项目名称:TTSFramework,代码行数:64,代码来源:FlowEngine.cs

示例2: ReadVerts


//.........这里部分代码省略.........
                                        Vertex vertex = new Vertex();
                                        vertex.x = x;
                                        vertex.y = y;
                                        vertex.z = z;
                                        currentChunk.vertices.Add(vertex);
                                    } else {
                                        int x = DataUtil.getLEUShort(fileData, offset);
                                        int y = DataUtil.getLEUShort(fileData, offset + 2);
                                        int z = DataUtil.getLEUShort(fileData, offset + 4);
                                        offset += 6;

                                        VLoc vloc = new VLoc();
                                        vloc.v1 = x;
                                        vloc.v2 = y;
                                        vloc.v3 = z;
                                        currentChunk.vlocs.Add(vloc);
                                    }
                                }
                                offset = (offset + 3) & ~3;
                            } else if (vn == 2 && vl == 2) {
                                // v3-8
                                int idx = offset;
                                for (int vnum = 0; vnum < numCommand; ++vnum) {
                                    SByteVector vec = new SByteVector();
                                    vec.x = (sbyte)fileData[idx++];
                                    vec.y = (sbyte)fileData[idx++];
                                    vec.z = (sbyte)fileData[idx++];
                                    currentChunk.normals.Add(vec);
                                }
                                int numBytes = ((numCommand * 3) + 3) & ~3;
                                offset += numBytes;
                            } else if (vn == 3 && vl == 0) {
                                // v4-32
                                log.LogLine("v4-32 data, " + numCommand + (numCommand == 1 ? " entry" : " entries") + ", addr=" + addr);
                                if (1 == numCommand) {
                                    currentChunk.gifTag0 = new GIFTag();
                                    currentChunk.gifTag0.parse(fileData, offset);
                                    DebugWrite(HexUtil.formatHex(offset) + " ");
                                    DebugWriteLine("GifTag: " + currentChunk.gifTag0.ToString());
                                } else if (2 == numCommand) {
                                    currentChunk.gifTag0 = new GIFTag();
                                    currentChunk.gifTag0.parse(fileData, offset);
                                    currentChunk.gifTag1 = new GIFTag();
                                    currentChunk.gifTag1.parse(fileData, offset + 16);

                                    DebugWrite(HexUtil.formatHex(offset) + " ");
                                    DebugWriteLine("GifTag0: " + currentChunk.gifTag0.ToString());
                                    DebugWrite(HexUtil.formatHex(offset) + " ");
                                    DebugWriteLine("GifTag1: " + currentChunk.gifTag1.ToString());
                                } else {
                                    log.LogLine("unknown number of gif commands.");
                                }
                                int numBytes = numCommand * 16;
                                offset += numBytes;
                            } else if (vn == 3 && vl == 1) {
                                // v4-16
                                log.LogLine("v4-16 data, " + numCommand + (numCommand == 1 ? " entry" : " entries") + ", addr=" + addr);
                                int numShorts = numCommand * 4;
                                if (usn) {
                                    currentChunk.extraVlocs = new ushort[numShorts];
                                    for (int i = 0; i < numCommand; ++i) {
                                        currentChunk.extraVlocs[i*4] = DataUtil.getLEUShort(fileData, offset + i * 8);
                                        currentChunk.extraVlocs[i * 4 + 1] = DataUtil.getLEUShort(fileData, offset + i * 8 + 2);
                                        currentChunk.extraVlocs[i * 4 + 2] = DataUtil.getLEUShort(fileData, offset + i * 8 + 4);
                                        currentChunk.extraVlocs[i * 4 + 3] = DataUtil.getLEUShort(fileData, offset + i * 8 + 6);
                                    }
开发者ID:Stranho,项目名称:bgda-explorer,代码行数:67,代码来源:VifDecoder.cs

示例3: Decode

        public WorldData Decode(EngineVersion engineVersion, WorldTexFile texFile, ILogger log, byte[] data, int startOffset, int length)
        {
            WorldData worldData = new WorldData();

            var reader = new DataReader(data, startOffset, length);

            int numElements = reader.ReadInt32();       // 0

            reader.Skip(12); // Skipping 3 ints

            int numCols = reader.ReadInt32();           // x10
            int numRows = reader.ReadInt32();           // x14

            reader.Skip(12); // Skipping 3 ints         // x18 x1c x20
            int elementArrayStart = reader.ReadInt32(); // x24

            reader.Skip(8); // Skipping 2 ints
            int off38Cols = reader.ReadInt32();
            int off38Rows = reader.ReadInt32();
            int off38 = reader.ReadInt32();

            reader.Skip(28);
            int texll = reader.ReadInt32();
            int texur = reader.ReadInt32();
            int texX0 = texll % 100;
            int texY0 = texll / 100;
            int texX1 = texur % 100;
            int texY1 = texur / 100;

            reader.Skip(4);
            int worldTexOffsetsOffset = reader.ReadInt32();
            worldData.textureChunkOffsets = readTextureChunkOffsets(engineVersion, data, startOffset + worldTexOffsetsOffset, texX0, texY0, texX1+1, texY1);
            worldData.worldElements = new List<WorldElement>(numElements);

            for (int elementIdx = 0; elementIdx < numElements; ++elementIdx)
            {
                var element = new WorldElement();

                if (EngineVersion.ReturnToArms == engineVersion)
                {
                    reader.SetOffset(elementArrayStart + elementIdx * 0x3C);
                }
                else // Default to Dark Allience version
                {
                    reader.SetOffset(elementArrayStart + elementIdx * 0x38);
                }

                int vifDataOffset = reader.ReadInt32();

                if (EngineVersion.DarkAlliance == engineVersion)
                {
                    int tex2 = reader.ReadInt32();
                    if (tex2 != 0) {
                        log.LogLine("Tex2=" + tex2);
                    }
                }

                int vifLen = reader.ReadInt32();
                log.LogLine("-----------");
                log.LogLine("vifdata: " + vifDataOffset + ", " + vifLen);

                float x1 = reader.ReadFloat();
                float y1 = reader.ReadFloat();
                float z1 = reader.ReadFloat();
                float x2 = reader.ReadFloat();
                float y2 = reader.ReadFloat();
                float z2 = reader.ReadFloat();

                element.boundingBox = new Rect3D(x1, y1, z1, x2 - x1, y2 - y1, z2 - z1);

                log.LogLine("Bounding Box: " + element.boundingBox.ToString());

                int textureNum = reader.ReadInt32() / 0x40;
                log.LogLine("Texture Num: " + textureNum);

                int texCellxy = reader.ReadInt16();
                int y = texCellxy / 100;
                int x = texCellxy % 100;

                if (EngineVersion.ReturnToArms == engineVersion)
                {
                    x += texX0;
                    y += texY0;
                }

                if (textureNum != 0)
                {
                    if (EngineVersion.ReturnToArms == engineVersion)
                    {
                        element.Texture = texFile.GetBitmapRTA(x, y, textureNum);
                    }
                    else
                    {
                        element.Texture = texFile.GetBitmap(worldData.textureChunkOffsets[y, x], textureNum);
                    }
                }

                if (element.Texture != null)
                {
                    log.LogLine("Found in texture chunk: " + x + ", " + y);
//.........这里部分代码省略.........
开发者ID:Stranho,项目名称:bgda-explorer,代码行数:101,代码来源:WorldFileDecoder.cs

示例4: Decode

        public static List<Mesh> Decode(ILogger log, byte[] data, int startOffset, int length, int texturePixelWidth, int texturePixelHeight)
        {
            int numMeshes = data[startOffset + 0x12] & 0xFF;
            int offset1 = DataUtil.getLEInt(data, startOffset + 0x24);
            List<Mesh> meshes = new List<Mesh>();
            int totalNumChunks = 0;
            for (int meshNum = 0; meshNum < numMeshes; ++meshNum) {
                int offsetVerts = DataUtil.getLEInt(data, startOffset + 0x28 + meshNum * 4);
                int offsetEndVerts = DataUtil.getLEInt(data, startOffset + 0x2C + meshNum * 4);
                var chunks = ReadVerts(log, data, startOffset + offsetVerts, startOffset + offsetEndVerts);
                var Mesh = ChunksToMesh(log, chunks, texturePixelWidth, texturePixelHeight);
                meshes.Add(Mesh);
                totalNumChunks += chunks.Count;
            }
            log.LogLine("Num Meshes="+numMeshes);
            log.LogLine("Total Num Chunks=" + totalNumChunks);

            return meshes;
        }
开发者ID:Stranho,项目名称:bgda-explorer,代码行数:19,代码来源:VifDecoder.cs


注:本文中的ILogger.LogLine方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。