Cilicon icon indicating copy to clipboard operation
Cilicon copied to clipboard

Log with OSLog

Open HeEAaD opened this issue 1 year ago • 3 comments

Motivation

Observing the "SSH" log of the Cilicon.app requires to login to the host machine via remote desktop or VNC, because the log is not accessible on the command line.

Description

This PR logs all string that are logged to the "SSH" window also to the system log. Further its replaces all print statements with OSLog calls.

Examples

Get past "SSH" output:

log show --style compact --predicate 'subsystem=="com.traderepublic.cilicon" and category == "SSH"'

Get live "SSH" output:

log stream --style compact --predicate 'subsystem=="com.traderepublic.cilicon" and category == "SSH"'

Get all log messages (including debug and info):

log show --style compact --predicate 'subsystem=="com.traderepublic.cilicon"' --info --debug

HeEAaD avatar Nov 02 '23 13:11 HeEAaD

Just a data point, something I like about Cilicon is that host logging of the session isn't a big consideration for the self-hosting threat model. Maybe this could be an opt-in debug feature only?

Halle avatar Nov 02 '23 14:11 Halle

@Halle good point, @HeEAaD or what about making it opt-out?

Marcocanc avatar Nov 07 '23 15:11 Marcocanc

I would not consider this as a debug feature. But I agree, it might be better to have logging to the system as an opt-in feature because it might be unexpected that the output ends up in the system log.

HeEAaD avatar Nov 07 '23 15:11 HeEAaD