Dumb-ways-to-memorize
2D game
simple_logger.h
Go to the documentation of this file.
1 #ifndef __SIMPLE_LOGGER__
2 #define __SIMPLE_LOGGER__
3 /**
4  * simple_logger
5  * @license The MIT License (MIT)
6  * @copyright Copyright (c) 2015 EngineerOfLies
7  * Permission is hereby granted, free of charge, to any person obtaining a copy
8  * of this software and associated documentation files (the "Software"), to deal
9  * in the Software without restriction, including without limitation the rights
10  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11  * copies of the Software, and to permit persons to whom the Software is
12  * furnished to do so, subject to the following conditions:
13  * The above copyright notice and this permission notice shall be included in all
14  * copies or substantial portions of the Software.
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21  * SOFTWARE.
22  */
23 
24 /**
25  @brief initializes the simple logger. Will automatically cleanup at program exit.
26 
27  @param log_file_path the file to log to
28 */
29 void init_logger(const char *log_file_path);
30 
31 /**
32  @brief logs a message to stdout and to the configured log file
33  @param msg a string with tokens
34  @param ... variables to be put into the tokens.
35 */
36 #define slog(...) _slog(__FILE__,__LINE__,__VA_ARGS__)
37 void _slog(char *f,int l,char *msg,...);
38 
39 
40 #endif
41 
void _slog(char *f, int l, char *msg,...)
Definition: simple_logger.c:30
void init_logger(const char *log_file_path)
initializes the simple logger. Will automatically cleanup at program exit.
Definition: simple_logger.c:17