Skip to content

Logging: Add current program time to log output #5

@pyjarrett

Description

@pyjarrett

Purpose

Be able to identify when log messages are written to the log.

Method

Provide a "current runtime" timestamp in the log output:

Maybe something like:

// log.h
	cnLog_Print(system, verbosity, \
		"%15s %c: %40s:%i %15s SYS_%-10s: " msg " \n", \
		formattedTimeStamp,                            \
		LogVerbosityChar[verbosity], \
		__FILE__, __LINE__, \
		LogSystemsRegistered[system], \
		##__VA_ARGS__ \
		);
  • cnTime_Init should initialize the reference time
  • Provide a function to format the current time into a fixed-width "hours:minutes:seconds.microseconds"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions