-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathLogger.cs
More file actions
29 lines (24 loc) · 867 Bytes
/
Logger.cs
File metadata and controls
29 lines (24 loc) · 867 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using Microsoft.AspNetCore.Http;
namespace Fnproject.Fn.Fdk
{
sealed internal class Logger
{
readonly private static string framerName = Environment.GetEnvironmentVariable("FN_LOGFRAME_NAME");
readonly private static string frameHeader = Environment.GetEnvironmentVariable("FN_LOGFRAME_HDR");
public static void Start(IHeaderDictionary headers)
{
if (string.IsNullOrEmpty(Logger.framerName) ||
string.IsNullOrEmpty(Logger.frameHeader))
{
return;
}
string id = headers[Logger.frameHeader];
if (!string.IsNullOrEmpty(id))
{
Console.WriteLine("\n{0}={1}", Logger.frameHeader, id);
Console.Error.WriteLine("\n{0}={1}", Logger.frameHeader, id);
}
}
}
}