diff --git a/lib/log.js b/lib/log.js index e8a7858..f733971 100644 --- a/lib/log.js +++ b/lib/log.js @@ -1,8 +1,6 @@ // Generated by IcedCoffeeScript 108.0.12 (function() { - var L, Logger, default_level, default_logger_class, stringify, util; - - util = require('util'); + var L, Logger, default_level, default_logger_class, stringify; exports.levels = L = { NONE: 0, @@ -21,7 +19,7 @@ return ""; } else if (o instanceof Uint8Array) { return new TextDecoder().decode(o); - } else if (util.isError(o)) { + } else if (Error.isError(o)) { return o.toString(); } else { return "" + o; diff --git a/src/log.iced b/src/log.iced index 1ee719f..f8e0cfb 100644 --- a/src/log.iced +++ b/src/log.iced @@ -1,6 +1,3 @@ - -util = require 'util' - # # The standard logger for saying that things went wrong, or state changed, # inside the RPC system. You can of course change this to be whatever you'd @@ -23,7 +20,7 @@ default_level = L.INFO stringify = (o) -> if not o? then "" else if o instanceof Uint8Array then new TextDecoder().decode(o) - else if util.isError(o) then o.toString() + else if Error.isError(o) then o.toString() else ("" + o) ##======================================================================= diff --git a/test/all.iced b/test/all.iced index 493c95a..eb6f082 100644 --- a/test/all.iced +++ b/test/all.iced @@ -6,7 +6,6 @@ colors = require 'colors' deep_equal = require 'deep-equal' {debug,log,Logger,RobustTransport,Transport,Client} = require '../src/main' iced = require('../src/iced').runtime -util = require 'util' ##----------------------------------------------------------------------- @@ -71,7 +70,7 @@ class TestCase logger : () -> @_global.logger() search : (s, re, msg) -> - if util.isError(s) + if Error.isError(s) s = s.toString() @assert (s? and s.search(re) >= 0), msg