My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
Copyright 2010 Samuel Ahn

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package com.foomonger.swizframework.processors {

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;

/**
* LoggerProcessor injects a SwizLogger instance to the decorated property
* using the Bean source as the SwizLogger target.
*/
public class LoggerProcessor extends BaseMetadataProcessor {

protected static const LOGGER:String = "Logger";

override public function get priority():int {
return ProcessorPriority.INJECT + 1;
}

public function LoggerProcessor() {
super([LOGGER]);
}

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

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

}
}

Change log

r92 by samahn on Nov 5, 2010   Diff
Changed LoggerProcessor priority to be
just above InjectProcessor.
Go to: 
Project members, sign in to write a code review

Older revisions

r77 by samahn on Nov 5, 2010   Diff
Updated to
as3-signals-v0.7-15-g75a05a2 and swiz-
framework-v1.0.0-RC2-48-gceca861.
MediateSignal is now SignalHandler.
r66 by samahn on May 23, 2010   Diff
Updated to work with Swiz 1.0.0 RC1.
Killed SwizLoggerConfig.
r47 by samahn on Mar 20, 2010   Diff
Created SwizLoggerConfig class to help
define logging targets in MXML.
Created LoggerProcessor.
All revisions of this file

File info

Size: 1635 bytes, 51 lines
Powered by Google Project Hosting