Skip to content

Commit 180619a

Browse files
committed
Merge branch 'development'
2 parents b3c0fbd + 6482989 commit 180619a

File tree

6 files changed

+57
-69
lines changed

6 files changed

+57
-69
lines changed

ModuleConfig.cfc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ component {
88
// Module Properties
99
this.title = "ColdBox Debugger";
1010
this.author = "Curt Gratz - Ortus Solutions";
11+
this.version = "@build.version@[email protected]@";
1112
this.webURL = "https://www.ortussolutions.com";
1213
this.description = "The ColdBox Debugger Module";
1314
// If true, looks for views in the parent first, if not found, then in the module. Else vice-versa

box.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name":"ColdBox Debugger",
33
"author":"Ortus Solutions <[email protected]",
44
"location":"https://downloads.ortussolutions.com/ortussolutions/coldbox-modules/cbdebugger/@build.version@/[email protected]@.zip",
5-
"version":"2.1.0",
5+
"version":"2.2.0",
66
"slug":"cbdebugger",
77
"type":"modules",
88
"homepage":"https://github.com/coldbox-modules/cbdebugger",

changelog.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@ 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+
* More tests for logbox loading and appender registration
16+
17+
### Fixed
18+
19+
* Visual display of the debugger version
20+
21+
----
22+
1023
## [2.1.0] => 2020-MAY-14
1124

1225
### 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+
}

test-harness/config/Coldbox.cfc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
defaultEvent = "",
1818
requestStartHandler = "",
1919
requestEndHandler = "",
20-
applicationStartHandler = "",
20+
applicationStartHandler = "main.onAppInit",
2121
applicationEndHandler = "",
2222
sessionStartHandler = "",
2323
sessionEndHandler = "",

test-harness/handlers/Main.cfc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ component{
55

66
// Index
77
any function index( event,rc, prc ){
8+
log.info( "in the index event firing" );
89
}
910

1011
any function noDebugger( event, rc, prc ){
@@ -14,6 +15,14 @@ component{
1415

1516
// Run on first init
1617
any function onAppInit( event, rc, prc ){
18+
var logBox = controller.getLogBox();
19+
logBox.registerAppender( 'tracer', 'cbdebugger.includes.appenders.ColdboxTracerAppender' );
20+
var appenders = logBox.getAppendersMap( 'tracer' );
21+
// Register the appender with the root loggger, and turn the logger on.
22+
var root = logBox.getRootLogger();
23+
root.addAppender( appenders[ 'tracer' ] );
24+
root.setLevelMax( 4 );
25+
root.setLevelMin( 0 );
1726
}
1827

1928
}

0 commit comments

Comments
 (0)