Swiz 1.3.1 日志处理器

发布于 2024-12-08 16:50:50 字数 1824 浏览 0 评论 0原文

我尝试了一切方法让 Swiz 运行 LogProcessor。 以下是项目 Foomonger。 然而,我担心这些资源指的是旧版本的 swiz。

我想在没有 SwizLoggerConfig 的情况下实现 LogProceccor,因为我只需要能够将一些信息记录到 Thunderbolt。我不需要进一步的配置。之后我开始编写自己的 AbstractSwizLoggingTarget。

如果我将类复制到我的环境中,我会收到以下错误: TypeError: 错误 #1034: Typumwandlung fehlgeschlagen: org.swizframework.utils.logging::SwizLogger@e8aa8b1 kann nicht in mx.logging.ILogger umgewandelt werden。 (抱歉德语文本)

Der Quelltext:

package de.axurit.util
{
    import org.swizframework.core.Bean;
    import org.swizframework.processors.BaseMetadataProcessor;
    import org.swizframework.processors.ProcessorPriority;
    import org.swizframework.reflection.IMetadataTag;
    import org.swizframework.utils.logging.SwizLogger;
    
    public class LoggerProcessor extends BaseMetadataProcessor
    {
        
        protected static const LOGGER:String = "Logger";
        
        public function LoggerProcessor()
        {
            super([LOGGER]);
        }
        
        override public function get priority():int
        {
            return ProcessorPriority.INJECT +1;
        }
        
        override public function setUpMetadataTag(metadataTag:IMetadataTag, bean:Bean):void
        {
            var logger:SwizLogger = SwizLogger.getLogger(bean.source);
            bean.source[metadataTag.host.name] = logger; //here occurs the error
        }
        
        override public function tearDownMetadataTag(metadataTag:IMetadataTag, bean:Bean):void
        {
            bean.source[metadataTag.host.name] = null;
        }
        
        
    }
}

任何人都可以帮助我如何在 Swiz 中创建一个自己的用于中央日志记录(而不是调试)的 MetadataProcessor。我您需要更多代码,请告诉我,

谢谢 坦率

i try everything to get the LogProcessor for Swiz to run.
Here are the project Foomonger.
I fear however, the ressources refer to an old version of swiz.

I want to implement the LogProceccor without the SwizLoggerConfig, because i need only the possibility to log some informations to thunderbolt. i need no further configuration. After that i start to write my own AbstractSwizLoggingTarget.

If i copy the class into my environment, i get the follow error:
TypeError: Error #1034: Typumwandlung fehlgeschlagen: org.swizframework.utils.logging::SwizLogger@e8aa8b1 kann nicht in mx.logging.ILogger umgewandelt werden.
(Sorry for the german text)

Der Quelltext:

package de.axurit.util
{
    import org.swizframework.core.Bean;
    import org.swizframework.processors.BaseMetadataProcessor;
    import org.swizframework.processors.ProcessorPriority;
    import org.swizframework.reflection.IMetadataTag;
    import org.swizframework.utils.logging.SwizLogger;
    
    public class LoggerProcessor extends BaseMetadataProcessor
    {
        
        protected static const LOGGER:String = "Logger";
        
        public function LoggerProcessor()
        {
            super([LOGGER]);
        }
        
        override public function get priority():int
        {
            return ProcessorPriority.INJECT +1;
        }
        
        override public function setUpMetadataTag(metadataTag:IMetadataTag, bean:Bean):void
        {
            var logger:SwizLogger = SwizLogger.getLogger(bean.source);
            bean.source[metadataTag.host.name] = logger; //here occurs the error
        }
        
        override public function tearDownMetadataTag(metadataTag:IMetadataTag, bean:Bean):void
        {
            bean.source[metadataTag.host.name] = null;
        }
        
        
    }
}

Can anyone help me how to create an own MetadataProcessor for central logging (not debuggin) in Swiz. I you need more code, let me know that

Thank you
Frank

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

鼻尖触碰 2024-12-15 16:50:50

这是一段漫长而艰难的旅程。这是结果:

package de.axurit.util
{
    import org.swizframework.core.Bean;
    import org.swizframework.processors.BaseMetadataProcessor;
    import org.swizframework.reflection.IMetadataTag;
    import org.swizframework.utils.logging.SwizLogger;

    public class LoggerProcessor extends BaseMetadataProcessor
    {
        public function LoggerProcessor()
        {
            super(["Log"]);
        }

        override public function setUpMetadataTag(metadataTag:IMetadataTag, bean:Bean):void
        {
            super.setUpMetadataTag(metadataTag, bean);
            bean.source [metadataTag.host.name] = SwizLogger.getLogger(bean.source);
        }

        override public function tearDownMetadataTag(metadataTag:IMetadataTag, bean:Bean):void
        {
            super.tearDownMetadataTag(metadataTag,bean);
            bean.source[metadataTag.host.name] = null;
        }
    }
}

It was a long, hard journey. Here is teh result:

package de.axurit.util
{
    import org.swizframework.core.Bean;
    import org.swizframework.processors.BaseMetadataProcessor;
    import org.swizframework.reflection.IMetadataTag;
    import org.swizframework.utils.logging.SwizLogger;

    public class LoggerProcessor extends BaseMetadataProcessor
    {
        public function LoggerProcessor()
        {
            super(["Log"]);
        }

        override public function setUpMetadataTag(metadataTag:IMetadataTag, bean:Bean):void
        {
            super.setUpMetadataTag(metadataTag, bean);
            bean.source [metadataTag.host.name] = SwizLogger.getLogger(bean.source);
        }

        override public function tearDownMetadataTag(metadataTag:IMetadataTag, bean:Bean):void
        {
            super.tearDownMetadataTag(metadataTag,bean);
            bean.source[metadataTag.host.name] = null;
        }
    }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文