How to use the MAPL logging library, aka "pFlogger" - GEOS-ESM/MAPL GitHub Wiki

Introduction

MAPL now includes an logging library known as "pFlogger". The library is similar in spirit to the python logger. The logging specifications are described at runtime by a Yaml file. If using a MAPL application application such the GEOSgcm.x, GEOSldas.x etc... that uses the MAPL_Cap, the logging file can be passed to the application via the command line argument --logging_config. The Yaml file consists of top level keys in the dictionary named locks:, formatters:, handlers:, root:, and loggers: each of these can defined multiple entries if you want to define different formatters, handlers, etc...

Lock Description

Formatter Description

formatter_name:
  class: options, Formatter, MpiFormatter
  format: 
  comm: 

Handler Description

handler_name:
  class:
  filename:
  lock:
  level:
  formatter:
  rank_keyword:
  comm:
  unit:

Root

Loggers

Example with ExtData

To get debug information from ExtData to standard out add this to the logging.yaml file

   console:
      class: streamhandler
      formatter: basic
      unit: OUTPUT_UNIT
      level: DEBUG

   CAP.EXTDATA:
       handlers: [console]
       level: WARNING
       root_level: DEBUG