Skip to content

Commit

Permalink
asd
Browse files Browse the repository at this point in the history
  • Loading branch information
mencken-d committed Feb 9, 2025
1 parent faf8145 commit f56b4a8
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions netbox_ptov/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,17 @@ def emit(self, record):
if not self.job.data:
self.job.data = []
self.job.data.append(str(self))
messages.info(request, str(self))
self.job.save() # Save the updated job data

#class CustomFormatter(logging.Formatter):
# def formatTime(self, record, datefmt=None):
def formatTime(self, record, datefmt=None):
# Ensure record.created is a float timestamp
#timestamp = self.converter(record.created)
#messages.info(request, f'timestamp: {str(timestamp)}', extra_tags='safe')
#dt_object = datetime.datetime.fromtimestamp(str(timestamp), tz=timezone.utc)
#messages.info(request, f'dt_object: {str(dt_object)}', extra_tags='safe')
#return dt_object.isoformat()
timestamp = self.converter(record.created)
messages.info(request, f'timestamp: {str(timestamp)}', extra_tags='safe')
dt_object = datetime.datetime.fromtimestamp(str(timestamp), tz=timezone.utc)
messages.info(request, f'dt_object: {str(dt_object)}', extra_tags='safe')
return dt_object.isoformat()
return record.created

logging.basicConfig(level=logging.INFO,
Expand Down

0 comments on commit f56b4a8

Please sign in to comment.