Ejemplo n.º 1
0
        /// <summary>
        /// Log a simple text at a file
        /// </summary>
        /// <param name="msg"></param>
        public void Add(string msg)
        {
            if (string.IsNullOrEmpty(msg))
            {
                throw new ArgumentNullException("Message could not be empty.");
            }

            string text = string.Format("{0}: {1}\n", DateTime.Now, msg);

            _file.Append(text);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Log API at text file
        /// </summary>
        /// <param name="data"></param>
        public void Save(Models.API.Log data)
        {
            if (data == null)
            {
                throw new ArgumentNullException("Invalid data");
            }

            var json = Logic.CommonOperations.JSON.ObjToJson(data);

            _fileOperation.Append(json);
        }