Skip to content

Commit

Permalink
Filter ConsoleLogs from user code as function logs (#2209)
Browse files Browse the repository at this point in the history
  • Loading branch information
pragnagopa authored Sep 9, 2020
1 parent b7a269e commit 135d489
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Azure.Functions.Cli/Common/Utilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using Microsoft.Azure.WebJobs.Script;
using Microsoft.Azure.WebJobs.Script.Configuration;
using Microsoft.Azure.WebJobs.Script.Diagnostics;
using Microsoft.Azure.WebJobs.Script.Workers;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
Expand Down Expand Up @@ -246,7 +247,7 @@ internal static bool JobHostConfigSectionExists(IConfigurationRoot hostJsonConfi
/// <returns></returns>
internal static bool DefaultLoggingFilter(string category, LogLevel actualLevel, LogLevel userLogMinLevel, LogLevel systemLogMinLevel)
{
if (LogCategories.IsFunctionUserCategory(category))
if (LogCategories.IsFunctionUserCategory(category) || category.Equals(WorkerConstants.FunctionConsoleLogCategoryName, StringComparison.OrdinalIgnoreCase))
{
return actualLevel >= userLogMinLevel;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Azure.Functions.Cli/Helpers/GlobalCoreToolsSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static WorkerRuntime CurrentWorkerRuntime
{
if (_currentWorkerRuntime == WorkerRuntime.None)
{
ColoredConsole.Error.WriteLine(QuietWarningColor("Can't determine project language from files. Please use one of [--csharp, --javascript, --typescript, --java, --python, --powershell]"));
ColoredConsole.Error.WriteLine(QuietWarningColor("Can't determine project language from files. Please use one of [--csharp, --javascript, --typescript, --java, --python, --powershell], --custom"));
}
return _currentWorkerRuntime;
}
Expand Down

0 comments on commit 135d489

Please sign in to comment.