Files
MoHadiShibli--Control4Free/include/c4f_log.h
T
MoHadiShibli 4331ec79fd Cleanup: drop the diagnostic spike, one version source, public tests
The staged spike that worked out the VDA call order is no longer part of the
build. It is kept at tag spike-final.

- src/main.c is the service only: instance lock, credentials, MBus and pad
  init, then the web service. src/server.c and include/c4f_server.h are gone
  with stage 8, and so are the stage-only helpers in src/vda.c: the MBus bind
  and holds, the assignment and button-map probes, and the GoldHEN klog stream
  path. The service reads /dev/klog, which is what works.
- VERSION holds the only version number. Both Makefiles pass it in, the
  packager reads it for param.sfo and the package name, and the build and
  deploy scripts read it for the file they look for.
- The payload's log is /data/control4free/control4free.log, not spike.log.
- The page drops the protocol 1 branches: the payload has always answered 2.
  A console slot is a "controller" and a pad plugged into the phone or PC is a
  "gamepad", so the two no longer read as the same word.
- The host tests move to tests/, with tests/run.py to run all four suites. They
  build the real sources with the PS4 calls stubbed, so they need no console.
  klog_test now covers the device path only, and asserts that nothing ever
  connects to GoldHEN's klog server.
2026-10-05 01:53:11 +03:00

30 lines
1.0 KiB
C

/* Control4Free -- logging.
*
* Everything goes to klog (GoldHEN's klog server, port 3232) and is mirrored to a
* file on the console, so a run can be read back over FTP even if the klog
* connection dropped. Every line has [c4f] and elapsed HH:MM:SS.mmm, independent
* of the console's calendar. The previous run is kept in control4free.log.previous.
*
* c4fLogSetKlog(0) turns the klog half off. The /dev/klog scanner needs that:
* while it is reading, its own writes would come back round and bury the kernel
* lines it is looking for.
*/
#ifndef C4F_LOG_H
#define C4F_LOG_H
#define C4F_LOG_DIR "/data/control4free"
#define C4F_LOG_PATH C4F_LOG_DIR "/control4free.log"
void c4fLogOpen(void);
void c4fLogClose(void);
void c4fLogSetKlog(int enabled);
int c4fLogKlogEnabled(void);
void c4fLog(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
/* On-screen toast. Keep these few: each one interrupts the user. */
void c4fNotify(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
#endif /* C4F_LOG_H */