<commit_before>//
// Flambe - Rapid game development
// https://github.com/aduros/flambe/blob/master/LICENSE.txt

package flambe.server;

import flambe.util.Logger;

// TODO(bruno): Use one of the nodejs externs on haxelib
class Node
{
    public static var require (_require, null) :String -> Dynamic;
    public static var console (_console, null) :Dynamic;
    public static var process (_process, null) :Dynamic;

    // TODO(bruno): Use haxe's JSON API
    public static var stringify :Dynamic -> String = untyped JSON.stringify;
    public static var parse :String -> Dynamic = untyped JSON.parse;

    // FIXME(bruno): Multiple loggers with different tags is not supported
    public static function logger (tag :String) :Logger
    {
        var handler :LogHandler = new flambe.platform.html.HtmlLogHandler(tag);
#if !debug
        // Try to log to the syslog in production builds
        try {
            var syslog = require("node-syslog");
            handler = new SystemLogHander(syslog, tag);
        } catch (error :Dynamic) {<commit_msg>Remove Node.stringify/parse, use haxe.Json instead.<commit_after>//
// Flambe - Rapid game development
// https://github.com/aduros/flambe/blob/master/LICENSE.txt

package flambe.server;

import flambe.util.Logger;

// TODO(bruno): Use one of the nodejs externs on haxelib
class Node
{
    public static var require (_require, null) :String -> Dynamic;
    public static var console (_console, null) :Dynamic;
    public static var process (_process, null) :Dynamic;

    // FIXME(bruno): Multiple loggers with different tags is not supported
    public static function logger (tag :String) :Logger
    {
        var handler :LogHandler = new flambe.platform.html.HtmlLogHandler(tag);
#if !debug
        // Try to log to the syslog in production builds
        try {
            var syslog = require("node-syslog");
            handler = new SystemLogHander(syslog, tag);
        } catch (error :Dynamic) {
{'fraction_non_alphanumeric': 0.10147883732789394, 'fraction_numerical': 0.0, 'mean_word_length': 3.070539419087137, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7627657', 'n_tokens_mistral': 569, 'n_tokens_neox': 559, 'n_words': 197}