Skip to content

Commit ac6c7e4

Browse files
author
Michael Klishin
committed
Extract fn
1 parent 506af39 commit ac6c7e4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

dotnet/EmitLog.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,15 @@ public static void Main(string[] args)
1212
{
1313
channel.ExchangeDeclare("logs", "fanout");
1414

15-
var message = (args.Length > 0) ? string.Join(" ", args)
16-
: "info: Hello World!";
15+
var message = GetMessage(args);
1716
var body = Encoding.UTF8.GetBytes(message);
1817
channel.BasicPublish("logs", "", null, body);
1918
Console.WriteLine(" [x] Sent {0}", message);
2019
}
2120
}
21+
22+
private static string GetMessage(string[] args)
23+
{
24+
return ((args.Length > 0) ? string.Join(" ", args) : "info: Hello World!");
25+
}
2226
}

0 commit comments

Comments
 (0)