#1 2014-09-03 13:16:31

vladon
Member
From: Naberezhnye Chelny
Registered: 2014-09-03
Posts: 8
Website

TSynLog / TSynLogDB / TSQLLog - what's the difference?

What is the difference between TSynLog, TSynLogDB and TSQLLog?

And where is the TSynLogDB class defined? It appears in documentation, but there is no definition for this class in sources of mORMot.

Offline

#2 2014-09-03 13:40:57

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

Re: TSynLog / TSynLogDB / TSQLLog - what's the difference?

TSynLogDB appears only as demonstration purpose of a custom sub-class.
It could have been named TMySynLog or TWhateverLog.

TSynLog is defined at SynCommons.pas, and is the parent of all classes, with almost all features.
TSQLLog is defined in mORMot.pas and has a more advanced JSON serializer:

type
  /// logging class with enhanced RTTI
  // - will write TObject/TSQLRecord, enumerations and sets content as JSON
  // - is the default logging family used by the mORMot framework
  // - mORMotDB.pas unit will set SynDBLog := TSQLLog
  // - mORMotSQLite3.pas unit will set SynSQLite3Log := TSQLLog
  TSQLLog = class(TSynLog)
  protected
    procedure CreateLogWriter; override;
  end;

This is the only difference between the two.

Please read the SAD 1.18 pdf about those classes.

Offline

Board footer

Powered by FluxBB