Skip to content

Commit

Permalink
Making TraceWriter available on JobHostConfigurationBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
mathewc committed May 17, 2016
1 parent 0a2165f commit f315a3c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/WebJobs.Script/Config/JobHostConfigurationBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

using Microsoft.Azure.WebJobs.Host;
using Microsoft.Azure.WebJobs.ServiceBus;

namespace Microsoft.Azure.WebJobs.Script.Description
{
// Helper to collect configuration updates from the BindingMetadata and ultimately apply to the JobHostConfiguration.
public class JobHostConfigurationBuilder
{
public JobHostConfigurationBuilder(JobHostConfiguration config)
public JobHostConfigurationBuilder(JobHostConfiguration config, TraceWriter traceWriter)
{
this.Config = config;
this.TraceWriter = traceWriter;
this.EventHubConfiguration = new EventHubConfiguration();
this.ApiHubConfiguration = new ApiHubConfiguration();
}

internal JobHostConfiguration Config { get; private set; }

internal TraceWriter TraceWriter { get; private set; }

internal EventHubConfiguration EventHubConfiguration { get; private set; }

internal ApiHubConfiguration ApiHubConfiguration { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions src/WebJobs.Script/Host/ScriptHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -649,9 +649,9 @@ private void OnUnhandledException(object sender, UnhandledExceptionEventArgs e)
}

// Bindings may require us to update JobHostConfiguration.
private static void ApplyBindingConfiguration(Collection<FunctionDescriptor> functions, JobHostConfiguration hostConfig)
private void ApplyBindingConfiguration(Collection<FunctionDescriptor> functions, JobHostConfiguration hostConfig)
{
JobHostConfigurationBuilder builder = new JobHostConfigurationBuilder(hostConfig);
JobHostConfigurationBuilder builder = new JobHostConfigurationBuilder(hostConfig, TraceWriter);

foreach (var func in functions)
{
Expand Down

0 comments on commit f315a3c

Please sign in to comment.