From b5a736ba779bb98eb9ffe3dcc7a2343c3b9fd81a Mon Sep 17 00:00:00 2001 From: Luis Majano Date: Thu, 14 May 2020 11:04:19 -0500 Subject: [PATCH 1/3] version bump --- box.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/box.json b/box.json index ddaec55..d898a92 100644 --- a/box.json +++ b/box.json @@ -2,7 +2,7 @@ "name":"ColdBox Debugger", "author":"Ortus Solutions Date: Mon, 18 May 2020 09:38:37 -0500 Subject: [PATCH 2/3] Upgraded Appender to script and fixes for LogBox 6 --- changelog.md | 8 ++ includes/appenders/ColdboxTracerAppender.cfc | 99 +++++++------------- 2 files changed, 40 insertions(+), 67 deletions(-) diff --git a/changelog.md b/changelog.md index da98f26..3adcd4e 100644 --- a/changelog.md +++ b/changelog.md @@ -7,6 +7,14 @@ 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 + +---- + ## [2.1.0] => 2020-MAY-14 ### Added diff --git a/includes/appenders/ColdboxTracerAppender.cfc b/includes/appenders/ColdboxTracerAppender.cfc index 604ebe2..203bfdf 100644 --- a/includes/appenders/ColdboxTracerAppender.cfc +++ b/includes/appenders/ColdboxTracerAppender.cfc @@ -1,72 +1,37 @@ - - - - - - - - - - - - +/** + * 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; - - + } - - - + .getInstance( "debuggerService@cbdebugger" ); + return this; + } - - - - - - + /** + * Log a message + */ + function logMessage( required any logEvent ){ var loge = arguments.logEvent; var entry = ""; var traceSeverity = "information"; @@ -105,8 +70,8 @@ An appender that interfaces with the ColdBox Tracer Panel // send to coldBox debugger variables.debuggerService.pushTracer( entry, loge.getExtraInfo() ); - - - - + return this; + } + +} \ No newline at end of file From 6482989d810eefb9851627e1ea6709f47573ed7b Mon Sep 17 00:00:00 2001 From: Luis Majano Date: Mon, 18 May 2020 09:48:04 -0500 Subject: [PATCH 3/3] more tests and visual debugger version showing up --- ModuleConfig.cfc | 1 + changelog.md | 5 +++++ test-harness/config/Coldbox.cfc | 2 +- test-harness/handlers/Main.cfc | 9 +++++++++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ModuleConfig.cfc b/ModuleConfig.cfc index 09cc3a5..92786f5 100644 --- a/ModuleConfig.cfc +++ b/ModuleConfig.cfc @@ -8,6 +8,7 @@ component { // Module Properties this.title = "ColdBox Debugger"; this.author = "Curt Gratz - Ortus Solutions"; + this.version = "@build.version@+@build.number@"; 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 diff --git a/changelog.md b/changelog.md index 3adcd4e..7300a24 100644 --- a/changelog.md +++ b/changelog.md @@ -12,6 +12,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### 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 ---- diff --git a/test-harness/config/Coldbox.cfc b/test-harness/config/Coldbox.cfc index 62a0e9e..b251c85 100644 --- a/test-harness/config/Coldbox.cfc +++ b/test-harness/config/Coldbox.cfc @@ -17,7 +17,7 @@ defaultEvent = "", requestStartHandler = "", requestEndHandler = "", - applicationStartHandler = "", + applicationStartHandler = "main.onAppInit", applicationEndHandler = "", sessionStartHandler = "", sessionEndHandler = "", diff --git a/test-harness/handlers/Main.cfc b/test-harness/handlers/Main.cfc index 86a2328..a6f8fa8 100644 --- a/test-harness/handlers/Main.cfc +++ b/test-harness/handlers/Main.cfc @@ -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 ){ @@ -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 ); } } \ No newline at end of file