You are not logged in.
Pages: 1
TSynDaemon only accepts TSynDaemonSettings and it defines all properties as published which is not ideal because end user can change ServiceName and log details.
I belive it would be better if there's a parent/abstract class for TSynDaemonSettings which is used by TSynDaemon that defines properties but doesn't publish any, something like:
TCustomSynDaemonSettings = class(TSynJsonFileSettings)
protected
fServiceName: string;
fServiceDisplayName: string;
...
published
// empty list, nothing is published by default
end;
// And then I can decide what goes to settings file and can be changed by end user, for example:
TMyAppSettings = class(TCustomSynDaemonSettings)
private
FSomeSetting: string;
published
property SomeSetting: string read FSomeSetting write FSomeSetting;
property LogRotateFileCount; // allow user to change log rotate details only
end;
Also would be good if ServiceDescription function is defined as virtual so a custom service description could be provided if needed.
Last edited by igors233 (2022-03-21 05:05:28)
Offline
Good idea.
Should be available by https://github.com/synopse/mORMot2/commit/bc25e58c
and https://github.com/synopse/mORMot2/commit/804f08b6
(my modification doesn't change the current behavior, but you can inherit from TSynDaemonAbstractSettings if you need to hide some fields)
Offline
Excellent, works ideally, thank you.
Offline
Pages: 1