Conversation
types/index.d.ts
Outdated
| // https://man7.org/linux/man-pages/man7/systemd.journal-fields.7.html | ||
| export type JournalFields = { | ||
| message_id?: string, | ||
| code_file?: string, | ||
| code_line?: string, | ||
| code_func?: string, | ||
| errno?: string, | ||
| invocation_id?: string, | ||
| user_invocation_id?: string, | ||
| syslog_facility?: string, | ||
| syslog_identifier?: string, | ||
| syslog_pid?: string, | ||
| syslog_timestamp?: string, | ||
| syslog_raw?: string, | ||
| documentation?: string, | ||
| tid?: string, | ||
| unit?: string, | ||
| user_unit?: string | ||
| } |
There was a problem hiding this comment.
Sorry, I'm not a TS expert. Does this definition allow for custom fields?
There was a problem hiding this comment.
no! it doesn't
we can add a [custom: string]: string, let me get around that
| } | ||
|
|
||
| export default class systemd_journald { | ||
| constructor(defaultFields: JournalFields); |
There was a problem hiding this comment.
defaultFields is optional and can be omitted. Thus, change it like this?
| constructor(defaultFields: JournalFields); | |
| constructor(defaultFields?: JournalFields); |
Just guesstimating here :D
There was a problem hiding this comment.
my reasoning was that you wouldn't instantiate it and would use the static methods if you didn't want to provide defaults.
if you'd rather it be optional here too I'll accept the change
|
Woahhh ... sry for not replying. I somehow missed your reaction. Currently I'm on vacation. Please ping me if nothing happened till begin of June. |
|
@jue89 ping 🤭 |
added the allowed fields as listed in https://man7.org/linux/man-pages/man7/systemd.journal-fields.7.html minus the message and priority ones which are handled already in log.js