[go: up one dir, main page]

tracehx

Enhanced trace for Haxe (Browser JS)
https://github.com/FontStruct/tracehx

To install, run:

haxelib install tracehx 0.0.2 

See using Haxelib in Haxelib documentation for more information.

README.md

tracehx

NB: This is not really ready for public use – the API will almost certainly change.

Perhaps useful as an example of how to customize the haxe trace function.

Simple enhanced tracing (JS browser target only)

  • Provides access to different logging levels in the browser console
  • Permits easy logging of multiple values via a single trace call

– Obviously all also available via Browser.console.log etc. but sometimes, in multi-target projects you want to use trace.

Usage

import tracehx.Trace;
import tracehx.LogLevel;

// execute once per application
TraceHx.init(); 

var s = "hello world";
var o = {prop1: "hello", prop2: "world"}

trace(s, o);
trace(s, o, LogLevel.error);

Configuration

You can show/hide meta data about each trace statement. And also style the output for each log level. These are the defaults:


TraceHx.init({
        metaStyle: "color: lightgray",
        infoStyle: "color: #339900",
        errorStyle: "color: red",
        debugStyle: "color: blue",
        warnStyle: "color: orange",
        defaultStyle: "color: #333333",
        showMeta: true
});
Contributors
FontStruct
Version
0.0.2
Published
5 years ago
Dependencies
License
MIT

All libraries are free

Every month, more than a thousand developers use Haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on GitHub!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on GitHub