docfx icon indicating copy to clipboard operation
docfx copied to clipboard

[Feature Request] Ability to specify the log level when calling Docset.Build and Docset.Pdf

Open ramiabughazaleh opened this issue 10 months ago • 1 comments

Description I'm migrating from the docfx.exe console application to instead use the Docfx.App nuget package in my console application, but one of the things missing is the ability to set the log level.

For example, I used to be able to run docfx.exe docfx.json --logLevel Verbose but there doesn't seem to be an option when calling Docset.Build("docfx.json") or Docset.Pdf("docfx.json").

Proposed solution I'd like to be able to set the log level in the Options parameter.

For example:

BuildOptions buildOptions = new BuildOptions
{
    LogLevel = LogLevel.Verbose,
};
Docset.Build("docfx.json", buildOptions);

Alternative solutions I also thought about setting the log level in docfx.json like this:

{
  "rules": {
    "*": "verbose"
  }
}

but I didn't see any verbose logging output in the console for example.

Thank you.

ramiabughazaleh avatar Apr 04 '24 03:04 ramiabughazaleh

Related issue (#8872)

For temporary workaround. It can use internal RunBuild.Exec method directly. By using IgnoresAccessChecksToGenerator.

Example configs of csproj .

  <ItemGroup>
    <PackageReference Include="IgnoresAccessChecksToGenerator" Version="0.7.0" PrivateAssets="All" />
    <InternalsAssemblyName Include="Docfx.App" />
    <InternalsAssemblyName Include="Docfx.Dotnet" />
  </ItemGroup>

filzrev avatar Apr 04 '24 05:04 filzrev