com.kelvinluck.util.SOSLogPublisher |
Class to add the ability to output logged data to the PowerFlasher Socket Output Server.
Mostly just a simple conversion of Pablo Costantini’s LuminicBox.Log.TracePublisher code.
Requirements
This code requires that the LuminicBox.Log classes are in your classpath when you compile it and that you have a SOS Server running to see the output on. Also bear in mind that connections to the SOS Server are subject to Flash’s security restrictions.
Usage
import com.kelvinluck.util.LogWrapper;
import com.kelvinluck.util.SOSLogPublisher;
LogWrapper.getInstance().init();
LogWrapper.getLog().addPublisher(new SOSLogPublisher("myAppsName"));
LogWrapper.getLog().fatal("This is a fatal error :'(");
LogWrapper.getLog().error("This is an error :(");
LogWrapper.getLog().warn("This is a warning, warning, warning");
LogWrapper.getLog().info("This is information");
LogWrapper.getLog().debug("This is debugging info");
LogWrapper.getLog().debug([1,2,3,{a:"Part A", b:"Part B"}, "Some text", 99]);
See Also
http://sos.powerflasher.com/
http://sos.powerflasher.de/doc/1-04/
http://www.luminicbox.com/blog/?page=post&id=2
http://kelvinluck.com/article/logging-from-fame
Author
Kelvin Luck derived from the work of Pablo Costantini
License
Licensed under the MOZILLA PUBLIC LICENSE, Version 1.1 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/MPL-1.1.html
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Summary
| Class to add the ability to output logged data to the PowerFlasher Socket Output Server. |
| The colour of the background of log messages with a severity of FATAL |
| The colour of the background of log messages with a severity of ERROR |
| The colour of the background of log messages with a severity of WARN |
| The colour of the background of log messages with a severity of INFO |
| The colour of the background of log messages with a severity of DEBUG |
| Sets the string that is used to indent object blocks. |
| The maximum inspection depth. |
| Creates a SOSLogPublisher instance. |
| Internal, private function that makes it easier to send a command without worrying about the null byte or other implementation details. |
| Sends a log event through the socket to the SOS Server |
| Takes an anything and returns a pretty printed version by recursively moving down the object tree |
| |
| The name of the class of this object. |