Example #1
0
        public void ClearMessages(LogKey key)
        {
            var logger = GetLogger(key, false);

            if (logger != null)
            {
                ClearMessages(logger);
            }
        }
Example #2
0
        public Logger GetLogger(LogKey key, bool create = true)
        {
            Logger logger;

            if (!loggers.TryGetValue(key, out logger) && create)
            {
                logger = GlobalLogger.GetLogger(key.ToString());
                loggers.Add(key, logger);
            }
            return(logger);
        }
Example #3
0
        public bool RemoveLogger(LogKey key)
        {
            var logger = GetLogger(key, false);

            if (logger != null)
            {
                RemoveLogger(logger);
                loggers.Remove(key);
                return(true);
            }
            return(false);
        }
Example #4
0
 private void AssetBuilt(object sender, AssetBuiltEventArgs e)
 {
     Dispatcher.InvokeAsync(() =>
     {
         AssetViewModel asset = session.GetAssetById(e.AssetItem.Id);
         if (asset != null)
         {
             var key = LogKey.Get(e.AssetItem.Id, "Build");
             ClearMessages(key);
             RemoveLogger(key);
             AddLogger(key, e.BuildLog);
         }
     });
 }
Example #5
0
 public void AddLogger(LogKey key, Logger logger)
 {
     loggers.Add(key, logger);
     AddLogger(logger);
 }