log.c
/*
* Copyright 2020 New Relic Corporation. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/
#include "newrelic-telemetry-sdk.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
/*
* An example that initializes a logger and triggers a log message.
*/
int main() {
const char* api_key = getenv("NEW_RELIC_API_KEY");
if (!api_key) {
fprintf(stderr, "NEW_RELIC_API_KEY not set\n");
exit(1);
}
/* Initialize a logger with NULL. */
nrt_log_init(NRT_LOG_DEBUG, NULL);
/* Initialize a logger. */
nrt_log_init(NRT_LOG_DEBUG, "./nrt.log");
/* Initialize a configuration with an invalid host. */
/* Initialize a new client with the given API key. */
assert(NULL == client);
}
struct _nrt_client_config_t nrt_client_config_t
A configuration object used to initialize a nrt_client_t.
Definition: newrelic-telemetry-sdk.h:28
This is a helper library that supports sending New Relic data from within your C/C++ application.
struct _nrt_client_t nrt_client_t
A Client is capable of both queuing and sending span and metrics batches to a configured New Relic co...
Definition: newrelic-telemetry-sdk.h:34
nrt_client_config_t * nrt_client_config_new(const char *key)
Create a new client configuration with an Insights API key.
void nrt_client_config_set_endpoint_traces(nrt_client_config_t *config, const char *host, uint16_t port)
Configure the ingest host for traces.
Generated on Wed Sep 16 2020 23:07:29 for New Relic C Telemetry SDK by
