Spotify.NET/SpotifyAPI.Docs/docs/logging.md
Nova 300c51db3c
Minor fixes for comprehesion (#507)
Fixed capitalization, spelling, grammar, added gender-neutral language
2020-09-16 09:13:21 +02:00

1022 B

id title
logging Logging

The library provides a way to inject your own, custom HTTP Logger. By default, no logging is performed.

var config = SpotifyClientConfig
  .CreateDefault("YourAccessToken")
  .WithHTTPLogger(new YourHTTPLogger());

var spotify = new SpotifyClient(config);

The IHTTPLogger interface can be found here.

SimpleConsoleHTTPLogger

The library ships with a simple console-based logger.

var config = SpotifyClientConfig
  .CreateDefault("YourAccessToken")
  .WithHTTPLogger(new SimpleConsoleHTTPLogger());

var spotify = new SpotifyClient(config);

This logger produces a simple console output for debugging purposes:

GET tracks/NotAnid []
--> BadRequest application/json {  "error" : {    "status" : 400,    "message" : "

GET tracks/6YlOxoHWLjH6uVQvxUIUug []
--> OK application/json {  "album" : {    "album_type" : "album",    "arti