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));
53 /*remove this from argv*/
54 for (j=i+1; j<*argc; j++) {
59 i--; /* compensate effect of next loop incrementation */
60 WARN1("argc %d",*argc);
63 if (!found && defaultlog) {
64 TRYFAIL(gras_log_control_set(defaultlog));
67 /** init other submodules */
76 * Finalize the gras mecanisms.