Skip to content

Instantly share code, notes, and snippets.

Created Mar 2, 2012
What would you like to do?
simple logging to file
#include <stdarg.h>
#include <stdio.h>
static void log( char* string, ... )
va_list parameter;
char output[256];
FILE *f;
va_start( parameter, string );
vsnprintf( output, 255, string, parameter );
f = fopen( "output.log", "at" );
fprintf( f, "%s\n", output );
fclose( f );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment