Design Pattern Examples
Overview of object-oriented design patterns
Bridge_LoggerHelpers.cs
Go to the documentation of this file.
1
5
6using System;
7using System.Collections.Generic;
8using System.Linq;
9using System.Text;
10using System.Threading.Tasks;
11
13{
17 internal static class LoggerHelpers
18 {
23 private static string _GetTimeStamp()
24 {
25 return DateTime.Now.ToString();
26 }
27
34 public static string FormatLogLine(string logLevel, string msg)
35 {
36 string timestamp = _GetTimeStamp();
37 string output = String.Format("{0} [{1}] {2}", timestamp, logLevel, msg);
38 return output;
39 }
40 }
41}
static string _GetTimeStamp()
Return a regular time stamp of the current time.
static string FormatLogLine(string logLevel, string msg)
Format a line for logging, including time stamp.
The namespace containing all Design Pattern Examples implemented in C#.