(window.webpackJsonp=window.webpackJsonp||[]).push([[20],{152:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){returni})),n.d(t,"metadata",(function(){returnc})),n.d(t,"rightToc",(function(){returnl})),n.d(t,"default",(function(){returns}));varr=n(2),o=n(9),a=(n(0),n(186)),i={id:"logging",title:"Logging"},c={id:"logging",title:"Logging",description:"The library provides a way to inject your own, custom HTTP Logger. By default, no logging is performed.",source:"@site/docs/logging.md",permalink:"/SpotifyAPI-NET/docs/next/logging",editUrl:"https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/docs/logging.md",version:"next",lastUpdatedBy:"Jonas Dellinger",lastUpdatedAt:1592253431,sidebar:"docs",previous:{title:"Configuration",permalink:"/SpotifyAPI-NET/docs/next/configuration"},next:{title:"Proxy",permalink:"/SpotifyAPI-NET/docs/next/proxy"}},l=[{value:"SimpleConsoleHTTPLogger",id:"simpleconsolehttplogger",children:[]}],p={rightToc:l};functions(e){vart=e.components,n=Object(o.a)(e,["components"]);returnObject(a.b)("wrapper",Object(r.a)({},p,n,{components:t,mdxType:"MDXLayout"}),Object(a.b)("p",null,"The library provides a way to inject your own, custom HTTP Logger. By default, no logging is performed."),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-csharp"}),'var config = SpotifyClientConfig\n .CreateDefault("YourAccessToken")\n .WithHTTPLogger(new YourHTTPLogger());\n\nvar spotify = new SpotifyClient(config);\n')),Object(a.b)("p",null,"The ",Object(a.b)("inlineCode",{parentName:"p"},"IHTTPLogger")," interface can be found ",Object(a.b)("a",Object(r.a)({parentName:"p"},{href:"https://github.com/JohnnyCrazy/SpotifyAPI-NET/blob/master/SpotifyAPI.Web/Http/Interfaces/IHTTPLogger.cs"}),"here"),"."),Object(a.b)("h2",{id:"simpleconsolehttplogger"},"SimpleConsoleHTTPLogger"),Object(a.b)("p",null,"The library ships with a simple console-based logger"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-csharp"}),'var config = SpotifyClientConfig\n .CreateDefault("YourAccessToken")\n .WithHTTPLogger(new SimpleConsoleHTTPLogger());\n\nvar spotify = new SpotifyClient(config);\n')),Object(a.b)("p",null,"This logger produces a simple console output for debugging purposes:"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-text"}),'GET tracks/NotAnid []\n--\x3e BadRequest application/json { "error" : { "status" : 400, "message" : "\n\nGET tracks/6YlOxoHWLjH6uVQvxUIUug []\n--\x3e OK application/json { "album" : { "album_type" : "album", "arti\n')))}s.isMDXComponent=!0},186:function(e,t,n){"use strict";n.d(t,"a",(function(){returnu})),n.d(t,"b",(function(){returnb}));varr=n(0),o=n.n(r);functiona(e,t,n){returntine?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}functioni(e,t){varn=Object.keys(e);if(Object.getOwnPropertySymbols){varr=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){returnObject.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}returnn}functionc(e){for(vart=1;t<arguments.length;t++){varn=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}returne}functionl(e,t){if(null==e)return{};varn,r,o=function(e,t){if(null==e)return{};varn,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);returno}(e,t);if(Object.getOwnPropertySymbols){vara=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}returno}varp=o.a.createContext({}),s=function(e){vart=o.a.useContext(p),n=t;returne&&(n="function"==typeofe?e(t):c({},t,{},e)),n},u=function(e){vart=s(e.components);returno.a.createElement(p.Provider,{value:t},e.ch