5 /* Authors: Martin Quinson */
6 /* Copyright (C) 2003 the OURAGAN project. */
8 /* This program is free software; you can redistribute it and/or modify it
9 under the terms of the license (GNU LGPL) which comes with this package. */
11 #include "gras_private.h"
13 GRAS_LOG_NEW_DEFAULT_SUBCATEGORY(module,GRAS);
15 extern void gras_log_exit(void);
21 gras_module_new_fct_t new;
22 gras_module_finalize_fct_t finalize;
26 gras_init(int argc, char **argv) {
27 gras_init_defaultlog(argc, argv, NULL);
31 * gras_init_defaultlog:
35 * Initialize the gras mecanisms.
38 gras_init_defaultlog(int argc,char **argv, const char *defaultlog) {
44 INFO0("Initialize GRAS");
46 /** Set logs and init log submodule */
47 for (i=1; i<argc; i++) {
48 if (!strncmp(argv[i],"--gras-log=",strlen("--gras-log="))) {
50 opt=strchr(argv[i],'=');
52 TRYFAIL(gras_log_control_set(opt));
55 if (!found && defaultlog) {
56 TRYFAIL(gras_log_control_set(defaultlog));
59 /** init other submodules */
67 * Finalize the gras mecanisms.