Probably an amateur question, but reading American Cinematographer, I occasionally come across mention of "gamma function," S-log, C-log, and other logs. I was wondering what exactly these are, and what purpose they serve and so on? Thanks!
Videos
What is the difference between Canon Log, Canon Log 2 and Canon Log 3?
The original Canon Log delivers a dynamic range of approximately 12 stops, Canon Log 2 up to 16 stops, and Canon Log 3 up to 14 stops. Canon Log 2 retains more detail in darker areas than Canon Log 3 but also features an elevated noise floor. Canon Log 3 is easier to grade thanks to producing a cleaner image and retains the same amount of highlight information as Canon Log 2.
What is Canon Log used for?
Canon Log is used to capture video footage that has a wider dynamic range and exposure latitude than standard video. The Canon Log tone curve is applied at the point of capture to retain more details in the highlights and shadows compared to standard video.
How does Canon Log help with colour grading in post-production?
Canon Log helps with colour grading as it is recorded at 10-bit colour depth and provides a flat image with low saturation that is an excellent foundation for colour adjustments and HDR workflows. It is easier to match footage shot on different cameras that have been set to Canon Log, enabling clips from Cinema EOS and EOS mirrorless cameras to be combined and colour matched to give a consistent look on a multi-cam shoot.
You can use this
File logger.h
#ifndef LOGGER_H
#define LOGGER_H
void logger(const char* tag, const char* message);
#endif /* LOG_H */
File logger.c
#include "logger.h"
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
void logger(const char* tag, const char* message) {
time_t now;
time(&now);
printf("%s [%s]: %s\n", ctime(&now), tag, message);
}
It's probably not perfect, but it does satisfy the needs as you have presented them.
I suggest the log library which is written by myself --- zlog!
The way to fit your need in zlog is:
$ vi /etc/zlog.conf
[formats]
simple = "%D %c %m%n"
# don't know what the tag mean in your question, so put category of zlog instead
# log level is also available here, add %V means level
[rules]
my_cat.* "xxx.log"; simple
$ vi hello.c
#include <stdio.h>
#include "zlog.h"
int main(int argc, char** argv)
{
int rc;
zlog_category_t *c;
rc = dzlog_init("/etc/zlog.conf", "my_cat");
if (rc) {
printf("init failed\n");
return -1;
}
zlog_info(c, "hello, zlog");
zlog_fini();
return 0;
}
It will generate xxx.log in current directory as
2012-09-30 07:22:50 my_cat hello, zlog
Links:
Download: https://github.com/HardySimpson/zlog/archive/latest-stable.tar.gz
UsersGuide: http://hardysimpson.github.com/zlog/UsersGuide-EN.html
Hompage: http://hardysimpson.github.com/zlog/