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 13
13
// limitations under the License.
14
14
15
15
using System ;
16
+ using System . Runtime . InteropServices ;
16
17
using Serilog . Sinks . Notepad . Interop ;
17
18
18
19
namespace Serilog . Sinks . Notepad
@@ -38,6 +39,11 @@ public static class NotepadWindow
38
39
/// <param name="value">The string to be written</param>
39
40
public static void Write ( string value )
40
41
{
42
+ if ( ! RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
43
+ {
44
+ return ;
45
+ }
46
+
41
47
var notepadWindow = _notepadWindow . Value ;
42
48
notepadWindow . Write ( value ) ;
43
49
notepadWindow . Flush ( ) ;
@@ -48,6 +54,11 @@ public static void Write(string value)
48
54
/// </summary>
49
55
public static void WriteLine ( )
50
56
{
57
+ if ( ! RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
58
+ {
59
+ return ;
60
+ }
61
+
51
62
var notepadWindow = _notepadWindow . Value ;
52
63
notepadWindow . WriteLine ( ) ;
53
64
notepadWindow . Flush ( ) ;
@@ -59,6 +70,11 @@ public static void WriteLine()
59
70
/// <param name="value">The string to be written</param>
60
71
public static void WriteLine ( string value )
61
72
{
73
+ if ( ! RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
74
+ {
75
+ return ;
76
+ }
77
+
62
78
var notepadWindow = _notepadWindow . Value ;
63
79
notepadWindow . WriteLine ( value ) ;
64
80
notepadWindow . Flush ( ) ;
You can’t perform that action at this time.
0 commit comments