Ejemplo n.º 1
0
        public ErrorLogger(Stream stream, string toolName, string toolFileVersion, Version toolAssemblyVersion, CultureInfo culture)
        {
            Debug.Assert(stream != null);
            Debug.Assert(stream.Position == 0);

            _writer = new JsonWriter(new StreamWriter(stream));
            _descriptors = new DiagnosticDescriptorSet();
            _culture = culture;

            _writer.WriteObjectStart(); // root
            _writer.Write("$schema", "http://json.schemastore.org/sarif-1.0.0-beta.5");
            _writer.Write("version", "1.0.0-beta.5");
            _writer.WriteArrayStart("runs");
            _writer.WriteObjectStart(); // run

            WriteToolInfo(toolName, toolFileVersion, toolAssemblyVersion);

            _writer.WriteArrayStart("results");
        }
Ejemplo n.º 2
0
        public ErrorLogger(Stream stream, string toolName, string toolFileVersion, Version toolAssemblyVersion)
        {
            Debug.Assert(stream != null);
            Debug.Assert(stream.Position == 0);

            _writer = new JsonWriter(new StreamWriter(stream));

            _writer.WriteObjectStart(); // root
            _writer.Write("version", OutputFormatVersion);

            _writer.WriteArrayStart("runLogs");
            _writer.WriteObjectStart(); // runLog

            WriteToolInfo(toolName, toolFileVersion, toolAssemblyVersion);

            _writer.WriteArrayStart("results");
        }