1
- <!--- --------------------------------------------------------------------
2
- ********************************************************************************
3
- Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp
4
- www.coldbox.org | www.luismajano.com | www.ortussolutions.com
5
- ********************************************************************************
6
- Author : Luis Majano
7
- Date : 04/12/2009
8
- Description :
9
- An appender that interfaces with the ColdBox Tracer Panel
10
- ----------------------------------------------------------------------->
11
- < cfcomponent
12
- extends = " coldbox.system.logging.AbstractAppender"
13
- output = " false"
14
- hint = " An appender that interfaces with the ColdBox Tracer Panel"
15
- >
16
- <!--- Init --->
17
- < cffunction name = " init" access = " public" returntype = " ColdboxTracerAppender" hint = " Constructor" output = " false" >
18
- <!--- ************************************************************* --->
19
- < cfargument name = " name" required = " true" hint = " The unique name for this appender." / >
20
- < cfargument
21
- name = " properties"
22
- required = " false"
23
- default = " #structNew () #"
24
- hint = " A map of configuration properties for the appender"
25
- / >
26
- < cfargument
27
- name = " layout"
28
- required = " false"
29
- default = " "
30
- hint = " The layout class to use in this appender for custom message rendering."
31
- / >
32
- < cfargument
33
- name = " levelMin"
34
- required = " false"
35
- default = " 0"
36
- hint = " The default log level for this appender, by default it is 0. Optional. ex: LogBox.logLevels.WARN"
37
- / >
38
- < cfargument
39
- name = " levelMax"
40
- required = " false"
41
- default = " 4"
42
- hint = " The default log level for this appender, by default it is 5. Optional. ex: LogBox.logLevels.WARN"
43
- / >
44
- <!--- ************************************************************* --->
45
- < cfscript >
1
+ /**
2
+ * An appender that interfaces with the ColdBox Tracer Panel
3
+ */
4
+ component extends = " coldbox.system.logging.AbstractAppender" {
5
+
6
+ /**
7
+ * Constructor
8
+ */
9
+ function init (
10
+ required name ,
11
+ struct properties = {},
12
+ layout = " " ,
13
+ levelMin = 0 ,
14
+ levelMax = 4
15
+ ) {
46
16
// Init supertype
47
17
super .init ( argumentCollection = arguments );
48
18
return this ;
49
- < / cfscript >
50
- < / cffunction >
19
+ }
51
20
52
- < cffunction name = " onRegistration" access = " public" >
53
- < cfset variables .debuggerService = getColdBox ()
21
+ /**
22
+ * Called upon registration
23
+ */
24
+ function onRegistration () {
25
+ variables .debuggerService = getColdBox ()
54
26
.getWireBox ()
55
- .getInstance ( " debuggerService@cbdebugger" )>
56
- < / cffunction >
27
+ .getInstance ( " debuggerService@cbdebugger" );
28
+ return this ;
29
+ }
57
30
58
- <!--- Log Message --->
59
- < cffunction
60
- name = " logMessage"
61
- access = " public"
62
- output = " false"
63
- returntype = " void"
64
- hint = " Write an entry into the appender."
65
- >
66
- <!--- ************************************************************* --->
67
- < cfargument name = " logEvent" type = " any" required = " true" hint = " The logging event" / >
68
- <!--- ************************************************************* --->
69
- < cfscript >
31
+ /**
32
+ * Log a message
33
+ */
34
+ function logMessage ( required any logEvent ){
70
35
var loge = arguments .logEvent ;
71
36
var entry = " " ;
72
37
var traceSeverity = " information" ;
@@ -105,8 +70,8 @@ An appender that interfaces with the ColdBox Tracer Panel
105
70
106
71
// send to coldBox debugger
107
72
variables .debuggerService .pushTracer ( entry , loge .getExtraInfo () );
108
- < / cfscript >
109
- < / cffunction >
110
73
111
- <!------------------------------------------- PRIVATE ------------------------------------------>
112
- < / cfcomponent >
74
+ return this ;
75
+ }
76
+
77
+ }
0 commit comments