From c9a13f8923d1cc8798bcb07a0808855380d083c8 Mon Sep 17 00:00:00 2001 From: tobigun Date: Fri, 23 Apr 2010 12:16:36 +0000 Subject: reverted revision 2278 - Auto.inc: Log.LogError is not possible as ULog is not loaded at this point -> used ConsoleWriteLn instead git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2279 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/base/UTextEncoding.pas | 1 + src/encoding/Auto.inc | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/base/UTextEncoding.pas b/src/base/UTextEncoding.pas index 148cd5d4..0c9ba4cc 100644 --- a/src/base/UTextEncoding.pas +++ b/src/base/UTextEncoding.pas @@ -92,6 +92,7 @@ implementation uses StrUtils, pcre, + UCommon, ULog; type diff --git a/src/encoding/Auto.inc b/src/encoding/Auto.inc index 487e2e42..8c32b5d0 100644 --- a/src/encoding/Auto.inc +++ b/src/encoding/Auto.inc @@ -69,7 +69,6 @@ var Error: PChar; ErrorOffset: Integer; begin - // NOTICE: Log.LogError() is not possible here because it isn't loaded inherited Create(); self.FallbackEncoder := FallbackEncoder; self.UTF8Encoder := UTF8Encoder; @@ -82,7 +81,8 @@ begin if self.Regex = Nil then begin - Log.LogError ('UTF8 Regex compilation failed: ' + AnsiString(Error) + ' at ' + IntToStr(ErrorOffset), 'EncoderAuto.Create'); + // NOTICE: Log.LogError() is not possible here because it isn't loaded + ConsoleWriteLn(Format('ERROR: UTF8 Regex compilation failed: %s at %d', [Error, ErrorOffset])); end else begin @@ -91,13 +91,15 @@ begin if Error <> Nil then begin - Log.LogError ('UTF8 regex study failed: ' + AnsiString(Error), 'EncoderAuto.Create'); + // NOTICE: Log.LogError() is not possible here because it isn't loaded + ConsoleWriteLn('ERROR: UTF8 Regex study failed: ' + Error); end; end; end else begin - Log.LogError ('pcre not loaded. utf-8 autodetection will not work.', 'EncoderAuto.Create'); + // NOTICE: Log.LogError() is not possible here because it isn't loaded + ConsoleWriteLn('ERROR: pcre not loaded. utf-8 autodetection will not work.'); end; end; -- cgit v1.2.3