File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
src/Serilog.Sinks.Notepad/Sinks/Notepad Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 1313// limitations under the License.
1414
1515using System ;
16+ using System . Runtime . InteropServices ;
1617using Serilog . Sinks . Notepad . Interop ;
1718
1819namespace Serilog . Sinks . Notepad
@@ -38,6 +39,11 @@ public static class NotepadWindow
3839 /// <param name="value">The string to be written</param>
3940 public static void Write ( string value )
4041 {
42+ if ( ! RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
43+ {
44+ return ;
45+ }
46+
4147 var notepadWindow = _notepadWindow . Value ;
4248 notepadWindow . Write ( value ) ;
4349 notepadWindow . Flush ( ) ;
@@ -48,6 +54,11 @@ public static void Write(string value)
4854 /// </summary>
4955 public static void WriteLine ( )
5056 {
57+ if ( ! RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
58+ {
59+ return ;
60+ }
61+
5162 var notepadWindow = _notepadWindow . Value ;
5263 notepadWindow . WriteLine ( ) ;
5364 notepadWindow . Flush ( ) ;
@@ -59,6 +70,11 @@ public static void WriteLine()
5970 /// <param name="value">The string to be written</param>
6071 public static void WriteLine ( string value )
6172 {
73+ if ( ! RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
74+ {
75+ return ;
76+ }
77+
6278 var notepadWindow = _notepadWindow . Value ;
6379 notepadWindow . WriteLine ( value ) ;
6480 notepadWindow . Flush ( ) ;
You can’t perform that action at this time.
0 commit comments