/** * */ public void formattedLog(string sev, string key, params string[] args) { string str = String.Format(KeyToLog.GetValueOrDefault(key), args); switch (sev) { case "INFO": Logger.LogStatus(str); break; case "ERR": Logger.LogError(str); break; case "WARN": Logger.LogWarning(str); break; case "FATAL": Logger.LogFatal(str); break; case "DEBUG": Logger.LogDebug(str); break; default: Logger.LogWarning(sev + " is not a valid severity level."); Logger.LogStatus(str); break; } }
/** * Additional function to add new logging strings when necessary. * @key: The keyword to map to the template * @value: the interpolated template */ public void AddUniqueLogType(string key, string value) { KeyToLog.AddOrUpdate(key, value, (k, v) => v); }
/** * Additional function to add new logging strings when necessary. */ public void addUniqueLogType(string key, string value) { KeyToLog.Add(key, value); }
public void SetDefaultKeys() { KeyToLog.TryAdd("Exit", "Exiting the application."); KeyToLog.TryAdd("Start", "Starting the application."); }