From 87573bb26119cb4be4b3c4ef0ebc4042ecba59e3 Mon Sep 17 00:00:00 2001 From: Joshua Granick Date: Thu, 1 Sep 2016 12:26:20 -0700 Subject: [PATCH] Use Log class --- lime/Assets.hx | 47 +++++++++++++++++++--------------------------- lime/Lib.hx | 8 ++++++-- lime/app/Module.hx | 6 +----- 3 files changed, 26 insertions(+), 35 deletions(-) diff --git a/lime/Assets.hx b/lime/Assets.hx index a9e5e5eb0..e80e2311a 100644 --- a/lime/Assets.hx +++ b/lime/Assets.hx @@ -14,6 +14,8 @@ import lime.audio.AudioBuffer; import lime.graphics.Image; import lime.text.Font; import lime.utils.Bytes; +import lime.utils.Log; + /** *

The Assets class provides a cross-platform interface to access @@ -120,19 +122,19 @@ class Assets { } else { - printError ("[Assets] Audio asset \"" + id + "\" exists, but only asynchronously"); + Log.info ("Audio asset \"" + id + "\" exists, but only asynchronously"); } } else { - printError ("[Assets] There is no audio asset with an ID of \"" + id + "\""); + Log.info ("There is no audio asset with an ID of \"" + id + "\""); } } else { - printError ("[Assets] There is no asset library named \"" + libraryName + "\""); + Log.info ("There is no asset library named \"" + libraryName + "\""); } @@ -169,19 +171,19 @@ class Assets { } else { - printError ("[Assets] String or Bytes asset \"" + id + "\" exists, but only asynchronously"); + Log.info ("String or Bytes asset \"" + id + "\" exists, but only asynchronously"); } } else { - printError ("[Assets] There is no String or Bytes asset with an ID of \"" + id + "\""); + Log.info ("There is no String or Bytes asset with an ID of \"" + id + "\""); } } else { - printError ("[Assets] There is no asset library named \"" + libraryName + "\""); + Log.info ("There is no asset library named \"" + libraryName + "\""); } @@ -232,19 +234,19 @@ class Assets { } else { - printError ("[Assets] Font asset \"" + id + "\" exists, but only asynchronously"); + Log.info ("Font asset \"" + id + "\" exists, but only asynchronously"); } } else { - printError ("[Assets] There is no Font asset with an ID of \"" + id + "\""); + Log.info ("There is no Font asset with an ID of \"" + id + "\""); } } else { - printError ("[Assets] There is no asset library named \"" + libraryName + "\""); + Log.info ("There is no asset library named \"" + libraryName + "\""); } @@ -302,19 +304,19 @@ class Assets { } else { - printError ("[Assets] Image asset \"" + id + "\" exists, but only asynchronously"); + Log.info ("Image asset \"" + id + "\" exists, but only asynchronously"); } } else { - printError ("[Assets] There is no Image asset with an ID of \"" + id + "\""); + Log.info ("There is no Image asset with an ID of \"" + id + "\""); } } else { - printError ("[Assets] There is no asset library named \"" + libraryName + "\""); + Log.info ("There is no asset library named \"" + libraryName + "\""); } @@ -362,13 +364,13 @@ class Assets { } else { - printError ("[Assets] There is no asset with an ID of \"" + id + "\""); + Log.info ("There is no asset with an ID of \"" + id + "\""); } } else { - printError ("[Assets] There is no asset library named \"" + libraryName + "\""); + Log.info ("There is no asset library named \"" + libraryName + "\""); } @@ -405,19 +407,19 @@ class Assets { } else { - printError ("[Assets] String asset \"" + id + "\" exists, but only asynchronously"); + Log.info ("String asset \"" + id + "\" exists, but only asynchronously"); } } else { - printError ("[Assets] There is no String asset with an ID of \"" + id + "\""); + Log.info ("There is no String asset with an ID of \"" + id + "\""); } } else { - printError ("[Assets] There is no asset library named \"" + libraryName + "\""); + Log.info ("There is no asset library named \"" + libraryName + "\""); } @@ -866,17 +868,6 @@ class Assets { } - private static inline function printError (message:String):Void { - - #if debug - var callstack = CallStack.callStack (); - callstack.reverse(); - trace (CallStack.toString (callstack) + "\n" + message); - #else - trace (message); - #end - - } // Event Handlers diff --git a/lime/Lib.hx b/lime/Lib.hx index e2a9a79d4..b4e569f9f 100644 --- a/lime/Lib.hx +++ b/lime/Lib.hx @@ -1,19 +1,23 @@ package lime; +import haxe.PosInfos; +import lime.utils.Log; + + class Lib { @:noCompletion private static var __sentWarnings = new Map (); - public static function notImplemented (api:String):Void { + public static function notImplemented (api:String, ?posInfo:PosInfos):Void { if (!__sentWarnings.exists (api)) { __sentWarnings.set (api, true); - trace ("Warning: " + api + " is not implemented"); + Log.warn (api + " is not implemented", posInfo); } diff --git a/lime/app/Module.hx b/lime/app/Module.hx index 64bbda1c7..66afceaea 100644 --- a/lime/app/Module.hx +++ b/lime/app/Module.hx @@ -202,11 +202,7 @@ class Module implements IModule { * Called when a gamepad is connected * @param gamepad The gamepad that was connected */ - public function onGamepadConnect (gamepad:Gamepad):Void { - - trace ("onGamepadConnect (module)"); - - } + public function onGamepadConnect (gamepad:Gamepad):Void { } /**