src/core/log.c (view raw)
1/* Copyright (c) 2013-2016 Jeffrey Pfau
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6#include "log.h"
7
8#define MAX_CATEGORY 64
9
10struct mLogger* mLogGetContext(void) {
11 return NULL; // TODO
12}
13
14static int _category = 0;
15static const char* _categoryNames[MAX_CATEGORY];
16
17int mLogGenerateCategory(const char* name) {
18 ++_category;
19 if (_category < MAX_CATEGORY) {
20 _categoryNames[_category] = name;
21 }
22 return _category;
23}
24
25const char* mLogCategoryName(int category) {
26 if (category < MAX_CATEGORY) {
27 return _categoryNames[category];
28 }
29 return 0;
30}