code: def test_logging():
      with TemporaryDirectory() as tmpdir:
          test_data = _get_test_data()
          file_name = "test_log"
          output_dir = os.path.join(tmpdir, file_name)
  
          net = _get_test_network()
          ce_loss = loss.SoftmaxCrossEntropyLoss()
          acc = mx.gluon.metric.Accuracy()
          est = estimator.Estimator(
              net, loss=ce_loss, train_metrics=acc
          )
  
          est.logger.addHandler(logging.FileHandler(output_dir))
  
          train_metrics = est.train_metrics
          val_metrics = est.val_metrics
          logging_handler = event_handler.LoggingHandler(
              metrics=train_metrics
          )
          est.fit(test_data, event_handlers=[logging_handler], epochs=3)
          assert logging_handler.batch_index == 0
          assert logging_handler.current_epoch == 3
          assert os.path.isfile(output_dir)
          del est
  
imports: import os
  import logging
  import sys
  import re
  import mxnet
  from common import TemporaryDirectory
  from mxnet import np
  from mxnet.gluon import nn, loss
  from mxnet.gluon.contrib.estimator import estimator, event_handler
  from mxnet.gluon.contrib.estimator.event_handler import LoggingHandler
  from mxnet.gluon.contrib.estimator.event_handler import ValidationHandler
  from mxnet.gluon.contrib.estimator import EpochEnd
  from mxnet.gluon.data.dataset import Dataset
label_desc: Use image node_id 7 for calling a global function with example usage: test_logging() without return types