Пример #1
0
        /// <summary>
        /// Ctor now private - just called from the static Log method
        /// </summary>
        /// <param name="methodName">The name of the method being logged</param>
        /// <param name="options">The log options</param>
        private JS_MethodLogger(string methodName, JS_LogOptions options)
        {
            _methodName = methodName;
            _options    = options;
            _sw         = new Stopwatch();
            _sw.Start();
            SaveLogToFile(_methodName);

            //if ((_options & LogOptions.ExecutionTime) == LogOptions.ExecutionTime)
            //{
            //    _sw = new Stopwatch();
            //    _sw.Start();
            //}

            //if ((_options & LogOptions.Entry) == LogOptions.Entry)
            //{
            //    // Log method entry here
            //    SaveLogToFile(_methodName);
            //}
        }
Пример #2
0
 /// <summary>
 /// Log method entry
 /// </summary>
 /// <param name="methodName">The name of the method being logged</param>
 /// <param name="options">The log options</param>
 /// <returns>A disposable object or none if logging is disabled</returns>
 public static IDisposable Log(string methodName, JS_LogOptions options)
 {
     // If logging off then return null, else
     return(new JS_MethodLogger(methodName, options));
 }