Beispiel #1
0
        private static bool EnsureLogExists(EventLogEntrySettings settings, ICakeLog log)
        {
            var mgr = new EventLogManager(settings, log);

            if (mgr.LogExists())
            {
                return(true);
            }
            mgr.CreateLog();
            return(mgr.LogExists());
        }
Beispiel #2
0
        public static void CreateEventLog(this ICakeContext ctx, string logName)
        {
            if (ctx == null)
            {
                throw new ArgumentNullException(nameof(ctx));
            }
            if (ctx.IsInvalid())
            {
                NotSupported();
            }
            var settings = new EventLogEntrySettings {
                LogName = logName
            };
            var mgr = new EventLogManager(settings, ctx.Log);

            mgr.CreateLog();
        }