Пример #1
0
        private static ILogArgs MakeLog(ICakeContext context, ILogArgs l)
        {
            if (l != null)
            {
                return(l);
            }

            if (context != null)
            {
                return new LogArgs()
                       {
                           Info  = x => context.Log.Write(Verbosity.Normal, LogLevel.Information, x),
                           Warn  = x => context.Log.Write(Verbosity.Normal, LogLevel.Warning, x),
                           Echo  = x => context.Log.Write(Verbosity.Normal, LogLevel.Error, x),
                           Error = x => context.Log.Write(Verbosity.Verbose, LogLevel.Information, x),
                       }
            }
            ;

            return(new LogArgs()
            {
                Info = x => { },
                Warn = x => { },
                Echo = x => { },
                Error = x => { }
            });
        }
Пример #2
0
 public static int Collect(ICollectArgs c, ILogArgs l)
 {
     return(Api.Collect(c.ToParameters(), l.ToParameters()));
 }
Пример #3
0
 public static int Prepare(IPrepareArgs p, ILogArgs l)
 {
     return(Api.Prepare(p.ToParameters(), l.ToParameters()));
 }
Пример #4
0
 public static int Collect(this ICakeContext context, ICollectArgs c, ILogArgs l = null)
 {
     return(CSApi.Collect(c, MakeLog(context, l)));
 }
Пример #5
0
 public static int Prepare(this ICakeContext context, IPrepareArgs p, ILogArgs l = null)
 {
     return(CSApi.Prepare(p, MakeLog(context, l)));
 }