Setting logging

Prevision.io’s SDK can provide with more detailed information if you change the logging level. By default, it will only output warnings and errors.

To change the logging level, use pio.verbose() method:

previsionio.__init__.verbose(v, debug=False, event_log=False)

Set the SDK level of verbosity.

Parameters:
  • v (bool) – Whether to activate info logging
  • debug (bool, optional) – Whether to activate detailed debug logging (default: False)
  • event_log (bool, optional) – Whether to activate detailed event managers debug logging (default: False)

For example:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
import previsionio as pio

# CHANGE LOGGING LEVEL ------------------------------------------
pio.verbose(True, debug=True) # (add event_log=True
                              # for events logging)

# CLIENT INITIALIZATION -----------------------------------------
url = """https://<your instance>.prevision.io"""
token = """<your token>"""
pio.client.init_client(url, token)

# TESTING LOGS --------------------------------------------------
# fetching a dataset from the platform
dataset = pio.Dataset.from_name('helloworld')

# fetching a usecase from the platform
uc = pio.Supervised.from_name('helloworld classif')