Skip to content

Commit

Permalink
function for copying the default config file
Browse files Browse the repository at this point in the history
  • Loading branch information
otvam committed Dec 18, 2024
1 parent 3ca9391 commit 1e4970f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions scilogger/scilogger.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import os
import sys
import shutil
import datetime
import threading
import logging
Expand Down Expand Up @@ -533,6 +534,21 @@ def enable():
logging.disable(0)


def copy_config(filename):
"""
Copy the default logger configuration to a file.
Parameters
----------
filename : str
Filename where the default configuration will be copied.
"""

folder = importlib.resources.files("scilogger")
with importlib.resources.as_file(folder.joinpath("scilogger.ini")) as fid:
shutil.copyfile(fid, filename)


def get_timestamp():
"""
Get a timestamp with the current time.
Expand Down

0 comments on commit 1e4970f

Please sign in to comment.