Added old implementation files for daemon side of logger into src/log/daemon. Also added the global daemon to log.cpp, its creation in log_init, and the add_log_medium function for adding user-defined log media.
Changed the format string for date-time to be a static member and as a result set_date_format method now needs to be static.
Changed the default logmedium class to output correct logentry memeber variable names.
Added logmedium and logentry to the test Makefile. Also changed the method name in logmedium to log_message to be more Unix-like...like :-D
Introduced "random" daemon socket name. Really just /tmp/jnx-epoch_of_now which should be randome enough.
Forgot to say for the previous commit that I've added the thread_lock class that's a thin wrapper arround pthread mutex for convenience. I am using it in logdaemon to lock to worker pool.
Added thread_lock class to jnx namespace. Forgot to do that initially.
Added stream operators to date_time_impl so that we can easily pass internal date represenation between client and server sockets. Effectivelly date serialiser and deserialiser. Also changed the names of old camelcase methods to underscore style to be more Unix-like.
Now that I have serialisation methods for internal date reperesentation I don't need formatter to handle the conversion from string to date so removed those methods. It's a bad idea anyway because we cannot guarantee what information will be lost by the format string.
Removed unnecessary methods from date_time and changed to_string method name to be to_formatted_string to better reflect the intent.
Changed the way log outputs the date - it uses the operator << of the inside representation class now.
Periodic checkin. There is a weird bug that I am trying to trace, so just committing in order not to lose something that might be important later.
Debugged some problems with date_time class. I was missing a copy constructor which meant I couldn't do declaration and assignment in one breath. Now it's fixed. However, there are some problems with jnx_thread by the looks of it so I am getting a Segmentation Fault at the end of my test program. I'll have to debug that one before I merge into master.
Fixed a bug in jnx_list distructor. Case where head == null wasn't handled (i.e. no pushes were done). Also changed the log_tester to insert assembly no-op statements between date_time variable declarations/initialisations to ensure that the timestamps are definitely at least one clock cycle apart.
Changed no-ops to usleep calls. It's cleaner and safer for the test. The comparison between pointer date_time values still fails occasionally which means something's wrong with my comparison operator definitions.
Removed pointer version of comparison operators for date_time. In retrospect it was a stupid idea because when you're comparing two pointers to objects you're actually comparing integers. Lesson learned - avoid overloading operators that take pointers as arguments or think thrice about it at least.
Skeleton of the formatter - it'll be a jnx_list of format_node pointers which know how to display itself as strings.
Added header files for format_node class and it's descendents. They'll be implemented in date_formatter.cpp.
Removed log_tester binary from the repo.
Definitions for the format_node and its descendents' methods.