NAME

gc_log_message - Outputs the log message. Use it after Game Carrier initialization.

SYNOPSIS

#include <game-carrier/client.h>

GC_CLIENT_API
void gc_log_message(
    GCT_INT level,
    GCT_CSTR msg);

Parameters:

  • level GCT_INT Sets the logging level.
  • msg GCT_CSTR The message to output.

RETURN VALUE

None.

DESCRIPTION

The gc_log_message function outputs the log message, and it must be used after the initialization of the Game Carrier framework.

Before you initialize the framework by using the gc_clients_init, make sure to invoke the gc_log_setopt function with those logging flags that will be used by this gc_log_message operation.

Hence, this operation must be called after the gc_log_setup function.

The operation behavior is undefined in case it is called before the gc_log_setop and gc_clients_init functions.

The level parameter sets the logging level to determine the severity of logs to be generated. Supported values: GCL_NORMAL, GCL_VERBOSE, GCL_ERR, GCL_WARN, GCL_NOTICE, GCL_INFO, GCL_DEBUG, GCL_USER.

The msg parameter identifies a string value representing the message to output.

EXAMPLE

#include <game-carrier/client.h>

int main(int argc, char * argv[])
{
  gc_log_setopt(GCL_ERR | GCL_WARN | GCL_NOTICE, "game.%p.log", GCL_TO_STDERR);
  gc_log_message(GCL_ERR, "Error message");
  gc_log_message(GCL_WARN, "Warning message");
  gc_log_message(GCL_NOTICE, "Notice message");
  gc_log_message(GCL_INFO, "Info message");
  gc_log_message(GCL_DEBUG, "Debug message");
  gc_log_message(GCL_USER, "User message");
  return 0;
}

SEE ALSO

gc_log_setopt, gcl_level