Skip to content

Commit 3f446c4

Browse files
author
Alex Castells
authored
Merge pull request #2 from scm-spain/feature/logger
Feature/logger
2 parents 92043b1 + 83ed64f commit 3f446c4

File tree

4 files changed

+23
-3
lines changed

4 files changed

+23
-3
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,10 @@ All connectors should implement these methods in order to display Ads:
1313

1414
Connectors that support Ad loading without rendering yet (pre-load) should implement these methods:
1515

16-
* loadAd: Should return
16+
* loadAd: Should return the creative data from the Ad server
17+
18+
## Logger
19+
20+
Connectors that has any Log system integrated, should implement the Logger interface:
21+
22+
* enableDebug: Should enable or disable the debug tracing for the implementing connector

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@schibstedspain/openads-connector-api",
3-
"version": "1.0.0",
3+
"version": "1.1.0",
44
"description": "OpenAds Interfaces to be compliant developing a new OpenAds connector",
55
"main": "dist/",
66
"scripts": {

src/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import AdLoadable from './interface/AdLoadable'
22
import AdViewable from './interface/AdViewable'
3+
import Logger from './interface/Logger'
34

45
export {
56
AdLoadable,
6-
AdViewable
7+
AdViewable,
8+
Logger
79
}

src/interface/Logger.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* @interface
3+
*/
4+
export default class Logger {
5+
/**
6+
* Enables or disables debug mode depending on the debug value
7+
* @param {boolean} true enables debug, false disables it
8+
*/
9+
enableDebug ({debug}) {
10+
throw new Error('Logger#enableDebug must be implemented')
11+
}
12+
}

0 commit comments

Comments
 (0)