Logging logs in Windows
Alexander Zhirov
azhirov1991 at gmail.com
Fri Feb 3 15:51:28 UTC 2023
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
[application]
source\azh\log.d(3,8): Error: module `core.sys.posix.syslog`
import `syslog` not found
source\azh\query.d(7,8): Error: module `core.sys.posix.syslog`
import `LOG_NOTICE` not found
source\azh\query.d(7,8): Error: module `core.sys.posix.syslog`
import `LOG_ERR` not found
source\azh\query.d(7,8): Error: module `core.sys.posix.syslog`
import `LOG_INFO` not found
source\azh\query.d(7,8): Error: module `core.sys.posix.syslog`
import `LOG_WARNING` not found
source\app.d(12,8): Error: module `core.sys.posix.syslog` import
`LOG_NOTICE` not found
source\app.d(12,8): Error: module `core.sys.posix.syslog` import
`LOG_ERR` not found
source\app.d(12,8): Error: module `core.sys.posix.syslog` import
`LOG_INFO` not found
source\app.d(12,8): Error: module `core.sys.posix.syslog` import
`LOG_WARNING` not found
Error dmd failed with exit code 1.
```
A small fragment of the code used:
```d
...
import core.sys.posix.syslog : LOG_NOTICE, LOG_ERR, LOG_INFO,
LOG_WARNING;
import core.sys.posix.syslog : syslog;
...
void log(int priority, string message)
{
syslog(priority, (message ~ "\0").ptr);
}
...
```
More information about the Digitalmars-d-learn
mailing list