-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #321 from microsoft/pete-dev
More DP6 prep updates
- Loading branch information
Showing
35 changed files
with
362 additions
and
283 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<Include> | ||
<?define SetupVersionName="Developer Preview 6 arm64" ?> | ||
<?define SetupVersionNumber="1.0.24107.2219" ?> | ||
<?define SetupVersionNumber="1.0.24109.1831" ?> | ||
</Include> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
using Microsoft.Extensions.Logging; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.Linq; | ||
using System.Runtime.CompilerServices; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Windows.Foundation.Diagnostics; | ||
|
||
|
||
namespace Microsoft.Devices.Midi2.ConsoleApp | ||
{ | ||
public class LoggingService | ||
{ | ||
private LoggingChannel _loggingChannel; | ||
|
||
private static LoggingService? _current; | ||
|
||
public static LoggingService Current | ||
{ | ||
get | ||
{ | ||
if (_current == null) | ||
_current = new LoggingService(); | ||
|
||
return _current; | ||
} | ||
} | ||
|
||
|
||
public LoggingService() | ||
{ | ||
var channelId = new Guid("ce8536f1-a223-5028-7c7f-c64452906687"); | ||
// guid from: PS> [System.Diagnostics.Tracing.EventSource]::new("Microsoft.Midi.Console").Guid | ||
|
||
_loggingChannel = new LoggingChannel("MIDI Console", null, channelId); | ||
} | ||
|
||
private string BuildEventName(string filePath, string memberName) | ||
{ | ||
//var fileName = Path.GetFileName(filePath); | ||
|
||
var className = Path.GetFileNameWithoutExtension(filePath); | ||
|
||
return $"{className}::{memberName}"; | ||
} | ||
|
||
|
||
public void LogError(string message, [CallerMemberName] string memberName = "", [CallerFilePath] string filePath = "") | ||
{ | ||
string eventName = BuildEventName(filePath, memberName); | ||
|
||
var fields = new LoggingFields(); | ||
fields.AddString("file name", filePath); | ||
fields.AddString("message", message); | ||
|
||
_loggingChannel.LogEvent(eventName, fields, LoggingLevel.Error); | ||
} | ||
|
||
public void LogError(string message, Exception ex, [CallerMemberName] string memberName = "", [CallerFilePath] string filePath = "") | ||
{ | ||
string eventName = BuildEventName(filePath, memberName); | ||
|
||
var fields = new LoggingFields(); | ||
fields.AddString("file name", filePath); | ||
fields.AddString("message", message); | ||
fields.AddString("exception", ex.ToString()); | ||
|
||
_loggingChannel.LogEvent(eventName, fields, LoggingLevel.Error); | ||
} | ||
|
||
|
||
public void LogWarning(string message, [CallerMemberName] string memberName = "", [CallerFilePath] string filePath = "") | ||
{ | ||
string eventName = BuildEventName(filePath, memberName); | ||
|
||
var fields = new LoggingFields(); | ||
fields.AddString("file name", filePath); | ||
fields.AddString("message", message); | ||
|
||
_loggingChannel.LogEvent(eventName, fields, LoggingLevel.Warning); | ||
} | ||
|
||
public void LogInfo(string message, [CallerMemberName] string memberName = "", [CallerFilePath] string filePath = "") | ||
{ | ||
string eventName = BuildEventName(filePath, memberName); | ||
|
||
var fields = new LoggingFields(); | ||
fields.AddString("file name", filePath); | ||
fields.AddString("message", message); | ||
|
||
_loggingChannel.LogEvent(eventName, fields, LoggingLevel.Information); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/user-tools/midi-settings/Microsoft.Midi.Settings/Contracts/Services/ILoggingService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Runtime.CompilerServices; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
using Microsoft.Extensions.Logging; | ||
|
||
namespace Microsoft.Midi.Settings.Contracts.Services | ||
{ | ||
public interface ILoggingService | ||
{ | ||
void LogError(string message, [CallerMemberName] string memberName = "", [CallerFilePath] string filePath = ""); | ||
|
||
void LogError(string message, Exception ex, [CallerMemberName] string memberName = "", [CallerFilePath] string filePath = ""); | ||
|
||
void LogWarning(string message, [CallerMemberName] string memberName = "", [CallerFilePath] string filePath = ""); | ||
|
||
void LogInfo(string message, [CallerMemberName] string memberName = "", [CallerFilePath] string filePath = ""); | ||
|
||
} | ||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.