Skip to content

Commit bd5193a

Browse files
committed
Upgraded Appender to script and fixes for LogBox 6
1 parent b5a736b commit bd5193a

File tree

2 files changed

+40
-67
lines changed

2 files changed

+40
-67
lines changed

changelog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
----
99

10+
## [2.2.0] => 2020-MAY-18
11+
12+
### Added
13+
14+
* Upgraded Appender to script and fixes for LogBox 6
15+
16+
----
17+
1018
## [2.1.0] => 2020-MAY-14
1119

1220
### Added
Lines changed: 32 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,37 @@
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+
) {
4616
// Init supertype
4717
super.init( argumentCollection = arguments );
4818
return this;
49-
</cfscript>
50-
</cffunction>
19+
}
5120

52-
<cffunction name="onRegistration" access="public">
53-
<cfset variables.debuggerService = getColdBox()
21+
/**
22+
* Called upon registration
23+
*/
24+
function onRegistration() {
25+
variables.debuggerService = getColdBox()
5426
.getWireBox()
55-
.getInstance( "debuggerService@cbdebugger" )>
56-
</cffunction>
27+
.getInstance( "debuggerService@cbdebugger" );
28+
return this;
29+
}
5730

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 ){
7035
var loge = arguments.logEvent;
7136
var entry = "";
7237
var traceSeverity = "information";
@@ -105,8 +70,8 @@ An appender that interfaces with the ColdBox Tracer Panel
10570

10671
// send to coldBox debugger
10772
variables.debuggerService.pushTracer( entry, loge.getExtraInfo() );
108-
</cfscript>
109-
</cffunction>
11073

111-
<!------------------------------------------- PRIVATE ------------------------------------------>
112-
</cfcomponent>
74+
return this;
75+
}
76+
77+
}

0 commit comments

Comments
 (0)