Skip to main content

Brainstorming package to manage logs in txt file

Project description

pybraflog Readme 📜

Brainstorming package to manage logs in txt file

Installation ⚡

Opérating system : Windows, MacOS & Linux :

Available function/class 📑

to create => FileUtils(afilename, adeffolder)

adeffolder : folder to write file. if not exist or empty error.
afilename  : the file name to write.

to open log => openlog

Open the log file.

to write info in log => writeLog(alog, anbrident)

alog : a line to add in file log. wothout add \n at the end to CRLF.
anbrident : to define indentation, number of space to add before alog, by default 0.

to clear log => clearoldlog(aretentionday)

to erase all log old than aretentionday, by default 15 days(optional).
You need to do when the filelog is open.

to close log => closelog()

Close the log file.

class log, this class is use to transfert txt log for function to parant function

value : for log in one line.
valuelst : for log in more lines.

Howto use 📰

import os
import pybraflog
import pybrafile

flog = pybraflog.FileLog('testlog.txt', '')
if flog.iserror:
    print(flog.error)

flog = pybraflog.FileLog('testlog.txt', os.getcwd())    
flog.openlog()

flog.writeLog('first line')
flog.writeLog('first line indent', 10)
flog.writeLog('two line')

flog.closelog()

file = pybrafile.FileUtils('testlog.txt')
file.openfile('r')
txt = file.readfile()
file.close()

print(txt)
print(pybraflog.version())

Meta 💬

Brainstorming – Support.erp@brainstorming.eu

Distributed under the MIT license. See LICENSE for more information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pybraflog-0.1.2.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pybraflog-0.1.2-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file pybraflog-0.1.2.tar.gz.

File metadata

  • Download URL: pybraflog-0.1.2.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.11 Windows/10

File hashes

Hashes for pybraflog-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b0604e85919d4fae2769d6247eefc4e450de36f23aba6ba7f52ebb956ee1f3cd
MD5 9d2888d436d36c1026f87c8f0e081b3a
BLAKE2b-256 84982d91dba3241886e80c2c6c0daf29b7d3b244d3f29be6e9504a527e762ea1

See more details on using hashes here.

File details

Details for the file pybraflog-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: pybraflog-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.11 Windows/10

File hashes

Hashes for pybraflog-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 351d055c429df64b9e3a2b34dd5301fb11b5d74e454e6b7d9b183d9a102e966c
MD5 c12fd4f42e260dc3d142ae2f1092a18e
BLAKE2b-256 94a5fa3934887b8243e19e41f127e7ee5fc98a9cd9ef33f6f98f4157c028d80a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page