Ejemplo n.º 1
0
        /**
         *
         */
        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;
            }
        }
Ejemplo n.º 2
0
 /**
  * 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);
 }
Ejemplo n.º 3
0
 /**
  * Additional function to add new logging strings when necessary.
  */
 public void addUniqueLogType(string key, string value)
 {
     KeyToLog.Add(key, value);
 }
Ejemplo n.º 4
0
 public void SetDefaultKeys()
 {
     KeyToLog.TryAdd("Exit", "Exiting the application.");
     KeyToLog.TryAdd("Start", "Starting the application.");
 }