Re: Logging logs in Windows

2023-04-18 Thread Alexander Zhirov via Digitalmars-d-learn
On Tuesday, 18 April 2023 at 12:08:35 UTC, Richard (Rikki) Andrew Cattermole wrote: Sounds like a simple case of not linking against the right library: https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-reporteventa Library Advapi32.lib DLL Advapi32.dll Should be as si

Re: Logging logs in Windows

2023-04-18 Thread Alexander Zhirov via Digitalmars-d-learn
On Saturday, 4 February 2023 at 14:48:55 UTC, Richard (Rikki) Andrew Cattermole wrote: I.e. here are my functions for syslog and Windows Event log (I won't copy it all, it won't be helpful & the file log function is giant compared). ```d void syslog() { version (Pos

Re: Logging logs in Windows

2023-04-18 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
Sounds like a simple case of not linking against the right library: https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-reporteventa Library Advapi32.lib DLL Advapi32.dll Should be as simple as adding advapi32 to your libs directive.

Re: Logging logs in Windows

2023-02-07 Thread Kagamin via Digitalmars-d-learn
On Saturday, 4 February 2023 at 13:31:41 UTC, Alexander Zhirov wrote: I understand that programming under Windows is a shame for a programmer, but is there really no ready-made solution for using the system log in Windows? It would be a logging library like log4j that would have different log

Re: Logging logs in Windows

2023-02-04 Thread Alexander Zhirov via Digitalmars-d-learn
On Saturday, 4 February 2023 at 14:48:55 UTC, Richard (Rikki) Andrew Cattermole wrote: I.e. here are my functions for syslog and Windows Event log I'll try to check. Thank you very much!

Re: Logging logs in Windows

2023-02-04 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
On 05/02/2023 2:31 AM, Alexander Zhirov wrote: On Friday, 3 February 2023 at 18:02:59 UTC, Richard (Rikki) Andrew Cattermole wrote: Here is a starting point that I myself have used in the past: I understand that programming under Windows is a shame for a programmer, but is there really no rea

Re: Logging logs in Windows

2023-02-04 Thread Alexander Zhirov via Digitalmars-d-learn
On Friday, 3 February 2023 at 18:02:59 UTC, Richard (Rikki) Andrew Cattermole wrote: Here is a starting point that I myself have used in the past: I understand that programming under Windows is a shame for a programmer, but is there really no ready-made solution for using the system log in Wi

Re: Logging logs in Windows

2023-02-03 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
On 04/02/2023 6:55 AM, Alexander Zhirov wrote: On Friday, 3 February 2023 at 16:00:55 UTC, Richard (Rikki) Andrew Cattermole wrote: Yes syslog is not available on Windows as that is a Posix API. All of your calls to syslog should be guarded by a version for Posix. Is there an analogue for Wind

Re: Logging logs in Windows

2023-02-03 Thread Alexander Zhirov via Digitalmars-d-learn
On Friday, 3 February 2023 at 16:00:55 UTC, Richard (Rikki) Andrew Cattermole wrote: Yes syslog is not available on Windows as that is a Posix API. All of your calls to syslog should be guarded by a version for Posix. Is there an analogue for Windows? And is it possible to implement it with t

Re: Logging logs in Windows

2023-02-03 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
Yes syslog is not available on Windows as that is a Posix API. All of your calls to syslog should be guarded by a version for Posix. The Windows Event Log which is comparable, isn't 1:1 so its a bit of a task to replace it.

Logging logs in Windows

2023-02-03 Thread Alexander Zhirov via Digitalmars-d-learn
I wrote a small utility in Linux. I want to build it for Windows. He swears at some parts of the code like this: ```powershell C:\sources\pxe-restore>dub build -b release Starting Performing "release" build using dmd for x86_64. Building pxe-restore ~master: building configuration [appl