Skip to content

Commit

Permalink
Merge branch 'release/5.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jericho committed Feb 8, 2019
2 parents 8bfd555 + ad2eb76 commit 10a70dc
Show file tree
Hide file tree
Showing 19 changed files with 284 additions and 2,651 deletions.
87 changes: 67 additions & 20 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Created with the help of https://www.gitignore.io/api/visualstudio
# Edit at https://www.gitignore.io/?templates=visualstudio

### VisualStudio ###
## Ignore Visual Studio temporary files, build results, and
Expand All @@ -7,6 +8,7 @@
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
Expand All @@ -22,16 +24,21 @@
[Rr]eleases/
x64/
x86/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/

# Visual Studio 2015 cache/options directory
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/

# Visual Studio 2017 auto generated files
Generated\ Files/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
Expand All @@ -45,20 +52,28 @@ TestResult.xml
[Rr]eleasePS/
dlldata.c

# Benchmark Results
BenchmarkDotNet.Artifacts/

# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
**/Properties/launchSettings.json

# StyleCop
StyleCopReport.xml

# Files built by Visual Studio
*_i.c
*_p.c
*_i.h
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
Expand All @@ -68,6 +83,7 @@ artifacts/
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
Expand Down Expand Up @@ -96,6 +112,9 @@ ipch/
*.vspx
*.sap

# Visual Studio Trace Files
*.e2e

# TFS 2012 Local Workspace
$tf/

Expand All @@ -116,6 +135,10 @@ _TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover

# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json

# Visual Studio code coverage results
*.coverage
*.coveragexml
Expand Down Expand Up @@ -151,11 +174,9 @@ publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Uncomment the next line to ignore your web deploy settings.
# By default, sensitive information, such as encrypted password
# should be stored in the .pubxml.user file.
#*.pubxml
*.pubxml.user
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj

# Microsoft Azure Web App publish settings. Comment the next line if you want to
Expand All @@ -166,11 +187,11 @@ PublishScripts/
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
Expand All @@ -188,12 +209,13 @@ AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx

# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/
!?*.[Cc]ache/

# Others
ClientBin/
Expand All @@ -206,9 +228,15 @@ ClientBin/
*.publishsettings
orleans.codegen.cs

# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk

# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# ASP.NET Core default setup: bower directory is configured as wwwroot/lib/ and bower restore is true
**/wwwroot/lib/

# RIA/Silverlight projects
Generated_Code/
Expand All @@ -220,6 +248,8 @@ _UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak

# SQL Server files
*.mdf
Expand All @@ -230,6 +260,7 @@ UpgradeLog*.htm
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser

# Microsoft Fakes
FakesAssemblies/
Expand All @@ -241,9 +272,6 @@ FakesAssemblies/
.ntvs_analysis.dat
node_modules/

# Typescript v1 declaration files
typings/

# Visual Studio 6 build log
*.plg

Expand Down Expand Up @@ -272,8 +300,8 @@ paket-files/
.idea/
*.sln.iml

# CodeRush
.cr/
# CodeRush personal settings
.cr/personal

# Python Tools for Visual Studio (PTVS)
__pycache__/
Expand All @@ -283,6 +311,9 @@ __pycache__/
tools/**
!tools/packages.config

# Tabs Studio
*.tss

# Telerik's JustMock configuration file
*.jmconfig

Expand All @@ -292,10 +323,26 @@ tools/**
*.odx.cs
*.xsd.cs

### VisualStudio Patch ###
# By default, sensitive information, such as encrypted password
# should be stored in the .pubxml.user file.
# OpenCover UI analysis results
OpenCover/

# Azure Stream Analytics local run output
ASALocalRun/

# MSBuild Binary and Structured Log
*.binlog

# NVidia Nsight GPU debugger configuration file
*.nvuser

# MFractors (Xamarin productivity tool) working folder
.mfractor/

# Local History for Visual Studio
.localhistory/

# BeatPulse healthcheck temp database
healthchecksdb

# WinMerge
*.bak
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace Picton.Messaging.IntegrationTests
{
using Logging;
using Picton.Messaging.Logging.LogProviders;
using System;
using System.Collections.Generic;
using System.Globalization;
Expand All @@ -23,7 +24,6 @@ public ColoredConsoleLogProvider(LogLevel minLevel = LogLevel.Trace)
_minLevel = minLevel;
}


/// <summary>
/// Gets the specified named logger.
/// </summary>
Expand All @@ -36,11 +36,11 @@ public Logger GetLogger(string name)
// messageFunc is null when checking if logLevel is enabled
if (messageFunc == null) return (logLevel >= _minLevel);
// Please note: locking is important to ensure that multiple threads
// don't attempt to change the foreground color at the same time
lock (this)
if (logLevel >= _minLevel)
{
if (logLevel >= _minLevel)
// Please note: locking is important to ensure that multiple threads
// don't attempt to change the foreground color at the same time
lock (this)
{
if (Colors.TryGetValue(logLevel, out ConsoleColor consoleColor))
{
Expand All @@ -61,27 +61,11 @@ public Logger GetLogger(string name)
}
}
}
return true;
};
}

private static void WriteMessage(
LogLevel logLevel,
string name,
Func<string> messageFunc,
object[] formatParameters,
Exception exception)
{
var message = messageFunc();
if (formatParameters?.Length > 0) message = string.Format(CultureInfo.InvariantCulture, message, formatParameters);
if (exception != null)
{
message = message + "|" + exception;
}
Console.WriteLine("{0} | {1} | {2} | {3}", DateTime.UtcNow, logLevel, name, message);
}


/// <summary>
/// Opens a nested diagnostics context. Not supported in EntLib logging.
/// </summary>
Expand All @@ -91,8 +75,7 @@ public IDisposable OpenNestedContext(string message)
{
return NullDisposable.Instance;
}



/// <summary>
/// Opens a mapped diagnostics context. Not supported in EntLib logging.
/// </summary>
Expand All @@ -111,5 +94,21 @@ private class NullDisposable : IDisposable
public void Dispose()
{ }
}

private static void WriteMessage(
LogLevel logLevel,
string name,
Func<string> messageFunc,
object[] formatParameters,
Exception exception)
{
var message = messageFunc();
if (formatParameters?.Length > 0) message = string.Format(CultureInfo.InvariantCulture, message, formatParameters);
if (exception != null)
{
message = message + "|" + exception;
}
Console.WriteLine("{0} | {1} | {2} | {3}", DateTime.UtcNow, logLevel, name, message);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,16 @@ public Task WriteAsync(Stream output, MetricsDataValueSource metricsData, Cancel
using (var streamWriter = new StreamWriter(output))
{
using (var writer = new MetricSnapshotDatadogWriter(streamWriter, _options))
serializer.Serialize(writer, metricsData);
serializer.Serialize(writer, metricsData, this.MetricFields);
}

return Task.CompletedTask;
}

/// <inheritdoc />
public MetricsMediaTypeValue MediaType => new MetricsMediaTypeValue("application", "com.datadoghq.metrics", "v1", "json");

/// <inheritdoc />
public MetricFields MetricFields { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ public void Dispose()
}

/// <inheritdoc />
public void Write(string context, string name, object value, MetricTags tags, DateTime timestamp)
public void Write(string context, string name, string field, object value, MetricTags tags, DateTime timestamp)
{
Write(context, name, new[] { "value" }, new[] { value }, tags, timestamp);
Write(context, name, new[] { field }, new[] { value }, tags, timestamp);
}

/// <inheritdoc />
Expand Down Expand Up @@ -133,7 +133,5 @@ private void Flush()
{
_streamWriter.Write(JsonConvert.SerializeObject(new SeriesJson { Series = _metrics.ToArray() }, JsonSettings));
}

public GeneratedMetricNameMapping MetricNameMapping { get; } = new GeneratedMetricNameMapping();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="App.Metrics.Reporting.Http" Version="2.0.0" />
<PackageReference Include="App.Metrics.Reporting.Http" Version="3.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 10a70dc

Please sign in to comment.