public int Calculate(int amount, int rate) { try { int r = amount / rate; return(r); } catch (Exception ex) { if (this.GetLog == LogType.TXT) { TxtLogger txf = new TxtLogger(); txf.Log(ex.Message); return(-1); } XmlLogger xm = new XmlLogger(); xm.Log(ex.Message); return(-1); } }