docfx
docfx copied to clipboard
[Feature Request] Ability to specify the log level when calling Docset.Build and Docset.Pdf
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.
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>