o
    Þ–+f  ã                   @   s$   d dl Z d dlZdd„ Zdd„ ZdS )é    Nc                 C   s^   t tj | d¡dƒ}tj tj ¡ d¡}t|ƒ}|d | }t|ƒ | 	|d ¡ | 
¡  d S )NÚlogÚaz%Y%m%d:%H%M%Sz * Ú
)ÚopenÚosÚpathÚjoinÚdatetimeÚstrftimeZnowÚ&insert_environment_variables_into_pathÚprintÚwriteÚclose)ZlogdirÚmsgÚfZdateStrÚstring© r   úT/home/exouser/operations/rsmas_insar/tools/PlotData/src/plotdata/logging_function.pyr      s   r   c                 C   s   |   d¡}g }|D ]7}t d¡|v r| t d¡d¡}t d¡|v r+| t d¡d¡}t d¡|v r;| t d¡d¡}| |¡ q	d |¡}|S )Nú Z
SAMPLESDIRz$SAMPLESDIRZ	TEMPLATESz$TEÚ
SCRATCHDIRz$SCRATCHDIR)Úsplitr   ÚgetenvÚreplaceÚappendr   )r   ZtoksZtoks_modZtokenZmsg_modr   r   r   r      s   

r   )r   r	   r   r   r   r   r   r   Ú<module>   s    
