Skip to content

Commit

Permalink
style(kernel): translate to english
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasanchez committed Apr 21, 2022
1 parent e5cb79a commit c2731b9
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions kernel/src/module/kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,20 @@

int on_init(context_t *context)
{
if (log_init(MODULE_NAME, true) == ERROR)
if (log_init(MODULE_NAME, true) EQ ERROR)
return LOG_INITIALIZATION_ERROR;

if (config_init("kernel") == ERROR)
LOG_DEBUG("Logger started.");

if (config_init(MODULE_NAME) EQ ERROR)
{
LOG_ERROR("No se pudo levantar la configuracion.");
LOG_ERROR("Could not open Configuration file.");
log_close();
return CONFIGURATION_INITIALIZATION_ERROR;
}

LOG_DEBUG("Configurations loaded.");

thread_manager_init();

/* BO initialization routines */
Expand All @@ -28,7 +33,10 @@ int on_init(context_t *context)
signals_init();

context->server = servidor_create(ip(), puerto_escucha());
LOG_DEBUG("Escuchando en %s:%s", ip(), puerto_escucha());

LOG_DEBUG("Server created at %s:%s", ip(), puerto_escucha());

LOG_DEBUG("Kernel Module started SUCCESSFULLY");

return EXIT_SUCCESS;
}
Expand All @@ -37,11 +45,11 @@ int on_run(context_t *context)
{
if (servidor_escuchar(&(context->server)) == -1)
{
LOG_ERROR("No se pudo levantar el servidor.");
LOG_ERROR("Server could not listen.");
return SERVER_RUNTIME_ERROR;
}

LOG_DEBUG("Servidor a la espera de clientes...");
LOG_DEBUG("Server listenning. Awaiting for connections.");

for (;;)
servidor_run(&(context->server), routine);
Expand All @@ -51,18 +59,21 @@ int on_run(context_t *context)

void on_before_exit(context_t *context, int exit_code)
{
LOG_DEBUG("Finalizando ejecucion.\n");
LOG_WARNING("Closing Kernel...");

thread_manager_end();

servidor_destroy(&(context->server));
LOG_WARNING("Server has stopped.");

/* BO finalization routines */

/* EO finalization routines */

config_close();

LOG_WARNING("Configurations unloaded.");
LOG_TRACE("Kernel ended with status <%d>.", exit_code);
log_close();

exit(exit_code);
Expand Down

0 comments on commit c2731b9

Please sign in to comment.