CClash.Logging.Emit C# (CSharp) Method

Emit() public static method

public static Emit ( string fmt ) : void
fmt string
return void
        public static void Emit(string fmt, params object[] args)
        {
            if (Settings.DebugEnabled)
            {
                for (int i = 0; i < 4; i++)
                {
                    try
                    {
                        if (Settings.DebugFile == "Console") {
                            Console.Error.WriteLine("p{0} t{1}:{2}", pid, 
                                Thread.CurrentThread.ManagedThreadId, 
                                string.Format(fmt, args));
                        } else {
                            File.AppendAllLines(Settings.DebugFile, new string[] { pid + ":" + string.Format(fmt, args) });
                        }
                        return;
                    }
                    catch {}
                }
            }
        }
    }

Usage Example

Example #1
0
 public CacheInfo(IFileCacheStore statCache)
 {
     cache = statCache;
     Logging.Emit("creating cache info mutex");
     statMtx = new Mutex(false, "cclash_stat_" + cache.FolderPath.ToLower().GetHashCode());
     Logging.Emit("created cache info mutex");
 }
All Usage Examples Of CClash.Logging::Emit