From 7d36daa5b72a3284ff29e004b3d0f84947bb4ce1 Mon Sep 17 00:00:00 2001 From: Aparajita Fishman Date: Fri, 3 Sep 2010 11:45:06 -0400 Subject: [PATCH] Added documentation for CPLogColorize --- Tests/Manual/CPLogTest/README | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Tests/Manual/CPLogTest/README b/Tests/Manual/CPLogTest/README index a8b27202c..71fc3b0bc 100644 --- a/Tests/Manual/CPLogTest/README +++ b/Tests/Manual/CPLogTest/README @@ -23,5 +23,13 @@ Each provider/level pair can have its own formatter. So, for example, you can us sent to CPLogPopup, a different formatter for other levels sent to CPLogPopup, and a totally different formatter for CPLogConsole. +If you are writing a command line app and want to colorize all or part of a message according to the level, +you can use: + +CPLogColorize(aString, aLevel) + +This function can safely be used within a browser environment, it just returns the string unmodified. +This allows you to reuse the same formatting functions for both environments. + For examples of usage in the browser, see main.j and AppController.j in the test app. For examples of usage in a command-line app, see test.j and run the file "execute_me". \ No newline at end of file