Skip to content

Commit

Permalink
fix debug logging logic
Browse files Browse the repository at this point in the history
  • Loading branch information
grantfirl committed Aug 10, 2024
1 parent 11ad77b commit c5dc7b0
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions scm/etc/scripts/dephy_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ def parse_arguments():
def setup_logging(debug):
"""Sets up the logging module."""
if debug:
logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO)
else:
logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.DEBUG)
else:
logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO)

class Case_Data(object):
def __init__(self, name, missing_value, time, levels, soil_depth, lat, lon, slmsk, vegsrc, vegtyp, soiltyp, \
Expand Down Expand Up @@ -2521,10 +2521,9 @@ def write_SCM_nml_file(case_nml):
#
########################################################################################
def main():
setup_logging()
(case_name, use_area, debug) = parse_arguments()

#read in arguments
(case_name, use_area) = parse_arguments()
setup_logging(debug)

(case_nml, error) = get_case_nml(case_name)
if (error):
Expand All @@ -2546,7 +2545,6 @@ def main():
logging.debug("Created {}".format(fileOUT))

write_SCM_nml_file(case_nml)
#logging.debug("Created {}".format(nmlOUT))

if __name__ == '__main__':
main()

0 comments on commit c5dc7b0

Please sign in to comment.