[wix-users] Session.Log replacement of []

Benny Bürger buerger at simba.de
Mon Jun 28 08:16:14 PDT 2021


Ok, I will give it a try.
Thank you


-----Ursprüngliche Nachricht-----
Von: wix-users <wix-users-bounces at lists.wixtoolset.org> Im Auftrag von Nir Bar via wix-users
Gesendet: Montag, 28. Juni 2021 17:04
An: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Cc: Nir Bar <nir.bar at panel-sw.com>
Betreff: Re: [wix-users] Session.Log replacement of []

session.Log formats the message using MSI rules before dumping to the log file.

You can escape it like:

session.Log($"      ***** [\\[]{DateTime.Now}[\\]] {message}");





--

Nir Bar

WiX Expert








---- On Mon, 28 Jun 2021 14:49:45 +0300 Benny Bürger_via_wix-users _ <wix-users at lists.wixtoolset.org> wrote ----



Hi, 
 
I have a custom action that is calling session.Log Because I want to know the exact time, I wrote an extension method: 
 
 internal static void LogWithTime(this Session session, string message) => session.Log($"      ***** [{DateTime.Now}] {message}"); 
 
Funny enough, after more than two years of usage I really needed to know the time: 
The output of each log was: "    ******   messageText". 
The text [DateTime...] has been replaced with a space. 
Is there some specific behaviour, that [] is replaced with something? 
 
Best regards,
Benny 
 
____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/

____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/


More information about the wix-users mailing list