#1 2017-01-18 21:28:34

yoanq
Member
Registered: 2013-01-03
Posts: 24

Problems using TDDDDaemon

Hi, ab.

Using the great possibilities that provides us with Mormot as a framework will suggest some changes.

Using the class TDDDDaemon (inheriting from it) is given the following situations:
  When you run ExecuteCommandLine with options to run by command line the system no provides output for it. You're not making use of AllocConsole.
  If they manage to get the output to the console, the system does not take into account what is configured for the Log in the property ConsoleLevels, always overwritten.

In the unit mORMotDB function TSQLRestExternalDBCreate you must call VirtualTableExternalRegisterAll before TSQLRestServer.CreateInMemoryForAllVirtualTables, in the current order generates error, because it does not initialize the external tables module.

Thank's

Offline

#2 2017-01-19 09:17:46

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,205
Website

Re: Problems using TDDDDaemon

You should explicitly define in the main program .dpr file:

{$APPTYPE CONSOLE}

(or set the corresponding project/option)
otherwise there is no way to know if the console is already there or not, IIRC.

Did you call TDDDAppSettingsAbstract.Initialize('') to initialize the settings and set the console log levels?

Fixed TSQLRestExternalDBCreate() via http://synopse.info/fossil/info/eac066bd64
We currently don't use this all-external tables feature (since we use mostly local SQLite3 and remote MongoDB), so we did not notice it.
Sorry for the inconvenience.

Thanks a lot for the feedback!

Offline

#3 2017-01-19 12:59:44

yoanq
Member
Registered: 2013-01-03
Posts: 24

Re: Problems using TDDDDaemon

Hi, ab

I call TDDDAppSettingsAbstract.Initialize(''), but in TDDDDaemon.ExecuteCommandLine when you run in console o verbose mode you override EchoToConsole value:

          case cmd of
            cConsole:
              SQLite3Log.Family.EchoToConsole := LOG_STACKTRACE + [sllDDDInfo];
            cVerbose:
              SQLite3Log.Family.EchoToConsole := LOG_VERBOSE;
          end;

In the case that I indicate these values on the command line, I am indicating that I am in console mode, and therefore could call in that case, AllocConsole, it is my personal opinion.

Many thanks for your always quick response.

Offline

#4 2017-01-19 19:43:39

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,205
Website

Re: Problems using TDDDDaemon

Offline

#5 2017-01-19 20:23:06

yoanq
Member
Registered: 2013-01-03
Posts: 24

Re: Problems using TDDDDaemon

Thank's ab.

All good. We keep in contact.

Offline

Board footer

Powered by FluxBB