Ejemplo n.º 1
0
        public static void Log(string Message, OmniusLogLevel level, OmniusLogSource source = OmniusLogSource.none, Application application = null, User user = null)
        {
            switch (level)
            {
            case OmniusLogLevel.Info:
                new OmniusInfo(Message)
                {
                    Application  = application,
                    User         = user,
                    SourceModule = source
                }.Save();
                break;

            case OmniusLogLevel.Warning:
                new OmniusWarning(Message)
                {
                    Application  = application,
                    User         = user,
                    SourceModule = source
                }.Save();
                break;

            case OmniusLogLevel.Error:
                new OmniusException(Message)
                {
                    Application  = application,
                    User         = user,
                    SourceModule = source
                }.Save();
                break;
            }
        }
Ejemplo n.º 2
0
        public override void InnerRun(Dictionary <string, object> vars, Dictionary <string, object> outputVars, Dictionary <string, object> InvertedInputVars, Message message)
        {
            // init
            COREobject core = COREobject.i;

            string         msg   = vars.ContainsKey("Message") ? (string)vars["Message"] : string.Empty;
            OmniusLogLevel level = vars.ContainsKey("Level") ? (OmniusLogLevel)vars["Level"] : OmniusLogLevel.Info;

            OmniusLog.Log(msg, level, OmniusLogSource.User, core.Application, core.User);
        }
Ejemplo n.º 3
0
 public OmniusLog(string Message, Exception innerException, OmniusLogLevel level) : base(Message, innerException)
 {
     Timestamp = DateTime.UtcNow;
     Level     = level;
     try
     {
         Server = HttpContext.Current.Request.Url.Authority;
     }
     catch (Exception)
     { }
 }
Ejemplo n.º 4
0
 public static void Log(COREobject core, string Message, OmniusLogLevel Level = OmniusLogLevel.Info)
 {
     OmniusLog.Log(Message, Level, OmniusLogSource.User, core.Application, core.User);
 }