Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
lmajano committed May 18, 2020
2 parents b3c0fbd + 6482989 commit 180619a
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 69 deletions.
1 change: 1 addition & 0 deletions ModuleConfig.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ component {
// Module Properties
this.title = "ColdBox Debugger";
this.author = "Curt Gratz - Ortus Solutions";
this.version = "@build.version@[email protected]@";
this.webURL = "https://www.ortussolutions.com";
this.description = "The ColdBox Debugger Module";
// If true, looks for views in the parent first, if not found, then in the module. Else vice-versa
Expand Down
2 changes: 1 addition & 1 deletion box.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name":"ColdBox Debugger",
"author":"Ortus Solutions <[email protected]",
"location":"https://downloads.ortussolutions.com/ortussolutions/coldbox-modules/cbdebugger/@build.version@/[email protected]@.zip",
"version":"2.1.0",
"version":"2.2.0",
"slug":"cbdebugger",
"type":"modules",
"homepage":"https://github.com/coldbox-modules/cbdebugger",
Expand Down
13 changes: 13 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

----

## [2.2.0] => 2020-MAY-18

### Added

* Upgraded Appender to script and fixes for LogBox 6
* More tests for logbox loading and appender registration

### Fixed

* Visual display of the debugger version

----

## [2.1.0] => 2020-MAY-14

### Added
Expand Down
99 changes: 32 additions & 67 deletions includes/appenders/ColdboxTracerAppender.cfc
Original file line number Diff line number Diff line change
@@ -1,72 +1,37 @@
<!-----------------------------------------------------------------------
********************************************************************************
Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp
www.coldbox.org | www.luismajano.com | www.ortussolutions.com
********************************************************************************
Author : Luis Majano
Date : 04/12/2009
Description :
An appender that interfaces with the ColdBox Tracer Panel
----------------------------------------------------------------------->
<cfcomponent
extends="coldbox.system.logging.AbstractAppender"
output ="false"
hint ="An appender that interfaces with the ColdBox Tracer Panel"
>
<!--- Init --->
<cffunction name="init" access="public" returntype="ColdboxTracerAppender" hint="Constructor" output="false">
<!--- ************************************************************* --->
<cfargument name="name" required="true" hint="The unique name for this appender."/>
<cfargument
name ="properties"
required="false"
default ="#structNew()#"
hint ="A map of configuration properties for the appender"
/>
<cfargument
name ="layout"
required="false"
default =""
hint ="The layout class to use in this appender for custom message rendering."
/>
<cfargument
name ="levelMin"
required="false"
default ="0"
hint ="The default log level for this appender, by default it is 0. Optional. ex: LogBox.logLevels.WARN"
/>
<cfargument
name ="levelMax"
required="false"
default ="4"
hint ="The default log level for this appender, by default it is 5. Optional. ex: LogBox.logLevels.WARN"
/>
<!--- ************************************************************* --->
<cfscript>
/**
* An appender that interfaces with the ColdBox Tracer Panel
*/
component extends="coldbox.system.logging.AbstractAppender" {

/**
* Constructor
*/
function init(
required name,
struct properties={},
layout="",
levelMin=0,
levelMax=4
) {
// Init supertype
super.init( argumentCollection = arguments );
return this;
</cfscript>
</cffunction>
}

<cffunction name="onRegistration" access="public">
<cfset variables.debuggerService = getColdBox()
/**
* Called upon registration
*/
function onRegistration() {
variables.debuggerService = getColdBox()
.getWireBox()
.getInstance( "debuggerService@cbdebugger" )>
</cffunction>
.getInstance( "debuggerService@cbdebugger" );
return this;
}

<!--- Log Message --->
<cffunction
name ="logMessage"
access ="public"
output ="false"
returntype="void"
hint ="Write an entry into the appender."
>
<!--- ************************************************************* --->
<cfargument name="logEvent" type="any" required="true" hint="The logging event"/>
<!--- ************************************************************* --->
<cfscript>
/**
* Log a message
*/
function logMessage( required any logEvent ){
var loge = arguments.logEvent;
var entry = "";
var traceSeverity = "information";
Expand Down Expand Up @@ -105,8 +70,8 @@ An appender that interfaces with the ColdBox Tracer Panel

// send to coldBox debugger
variables.debuggerService.pushTracer( entry, loge.getExtraInfo() );
</cfscript>
</cffunction>

<!------------------------------------------- PRIVATE ------------------------------------------>
</cfcomponent>
return this;
}

}
2 changes: 1 addition & 1 deletion test-harness/config/Coldbox.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
defaultEvent = "",
requestStartHandler = "",
requestEndHandler = "",
applicationStartHandler = "",
applicationStartHandler = "main.onAppInit",
applicationEndHandler = "",
sessionStartHandler = "",
sessionEndHandler = "",
Expand Down
9 changes: 9 additions & 0 deletions test-harness/handlers/Main.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ component{

// Index
any function index( event,rc, prc ){
log.info( "in the index event firing" );
}

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

// Run on first init
any function onAppInit( event, rc, prc ){
var logBox = controller.getLogBox();
logBox.registerAppender( 'tracer', 'cbdebugger.includes.appenders.ColdboxTracerAppender' );
var appenders = logBox.getAppendersMap( 'tracer' );
// Register the appender with the root loggger, and turn the logger on.
var root = logBox.getRootLogger();
root.addAppender( appenders[ 'tracer' ] );
root.setLevelMax( 4 );
root.setLevelMin( 0 );
}

}

0 comments on commit 180619a

Please sign in to comment.