#1 2018-11-30 16:15:46

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,544
Website

TSynLog inheritance

I have a request from my customers about logging contains "garbage" (from customer POV). In most case they mean class names and pointers in the log files.
Thanks to TSynLog flexibility I solve most of the problems in my TSynLog descendants. The last is a database access class instance and pointer ( ubDBSQLite3ThreadSafe.TubSQLite3Statement(00007FE57AFB0160) below, but the same for other RDBMS

20181130 16112052  "  +    			App.fetchAllOrExec
20181130 16112052  "  +    				App.prepareAndRun(conn=main/SQLite3)
20181130 16112052  " debug 					P1: String(34)	UBA.passwordPolicy.maxDurationDays
20181130 16112052  " SQL   					ubDBSQLite3ThreadSafe.TubSQLite3Statement(00007FE9F7BF9160) select settingValue from ubs_settings where settingKey =?
20181130 16112052  "  -    				00.000.121
20181130 16112052  " debug 				1 row(s) fetched
20181130 16112052  "  -    			00.000.238

Again, thanks to TSynLog flexibility I fix it by replacing a WriterClass in my TSynLog descendant BUT for this I need to override a TSynLog constructor, what impossible because it is not virtual.

@ab - is it possible to mark TSynLog.Create as virtual in master?

TSynLog
    constructor Create(aFamily: TSynLogFamily=nil); virtual;

The complete log samples before and after "simplification" is here

Last edited by mpv (2018-11-30 16:41:34)

Offline

#2 2018-12-01 08:48:22

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,544
Website

Re: TSynLog inheritance

A corresponding pull request #156

Offline

#3 2018-12-15 08:35:34

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,544
Website

Re: TSynLog inheritance

With new LogFamily.WithInstancePointer introduced in [1bbe0b67] i'm able to remove hacks for disabling pointer output from my code base. Thanks!

Offline

Board footer

Powered by FluxBB