Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Weblate
gajim
Commits
74a45a72
Commit
74a45a72
authored
19 years ago
by
Yann Leboulanger
Browse files
Options
Downloads
Patches
Plain Diff
we now save conferences history in a folder, and all pm related to this conference in this folder
parent
8139c645
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/common/logger.py
+35
-11
35 additions, 11 deletions
src/common/logger.py
with
35 additions
and
11 deletions
src/common/logger.py
+
35
−
11
View file @
74a45a72
...
...
@@ -62,32 +62,52 @@ class Logger:
if
not
msg
:
msg
=
''
msg
=
msg
.
replace
(
'
\n
'
,
'
\\
n
'
)
ji
=
jid
.
split
(
'
/
'
)[
0
]
if
len
(
jid
.
split
(
'
/
'
))
>
1
:
ji
,
nick
=
jid
.
split
(
'
/
'
,
1
)
else
:
ji
=
jid
nick
=
''
files
=
[]
if
kind
==
'
status
'
:
#we save time:jid:show:msg
if
not
show
:
show
=
'
online
'
if
common
.
gajim
.
config
.
get
(
'
log_notif_in_user_file
'
):
files
.
append
(
ji
)
path_to_file
=
os
.
path
.
join
(
LOGPATH
,
ji
)
if
os
.
path
.
isdir
(
path_to_file
):
files
.
append
(
ji
+
'
/
'
+
ji
)
if
os
.
path
.
isfile
(
jid
):
files
.
append
(
jid
)
else
:
files
.
append
(
ji
)
if
common
.
gajim
.
config
.
get
(
'
log_notif_in_sep_file
'
):
files
.
append
(
'
notify.log
'
)
elif
kind
==
'
incoming
'
:
# we save time:recv:message
files
.
append
(
ji
)
path_to_file
=
os
.
path
.
join
(
LOGPATH
,
ji
)
if
os
.
path
.
isdir
(
path_to_file
):
files
.
append
(
jid
)
else
:
files
.
append
(
ji
)
jid
=
'
recv
'
show
=
msg
msg
=
''
elif
kind
==
'
outgoing
'
:
# we save time:sent:message
files
.
append
(
ji
)
path_to_file
=
os
.
path
.
join
(
LOGPATH
,
ji
)
if
os
.
path
.
isdir
(
path_to_file
):
files
.
append
(
jid
)
else
:
files
.
append
(
ji
)
jid
=
'
sent
'
show
=
msg
msg
=
''
elif
kind
==
'
gc
'
:
files
.
append
(
ji
)
jid
=
'
recv
'
jids
=
jid
.
split
(
'
/
'
)
nick
=
''
if
len
(
jids
)
>
1
:
nick
=
jids
[
1
]
elif
kind
==
'
gc
'
:
# we save time:gc:nick:message
# create the folder if needed
ji_fn
=
os
.
path
.
join
(
LOGPATH
,
ji
)
if
os
.
path
.
isfile
(
ji_fn
):
os
.
remove
(
ji_fn
)
if
not
os
.
path
.
isdir
(
ji_fn
):
os
.
mkdir
(
ji_fn
)
files
.
append
(
ji
+
'
/
'
+
ji
)
jid
=
'
gc
'
show
=
nick
for
f
in
files
:
path_to_file
=
os
.
path
.
join
(
LOGPATH
,
f
)
...
...
@@ -102,6 +122,8 @@ class Logger:
'''
return total number of lines in a log file
return 0 if log file does not exist
'''
path_to_file
=
os
.
path
.
join
(
LOGPATH
,
jid
.
split
(
'
/
'
)[
0
])
if
os
.
path
.
isdir
(
path_to_file
):
path_to_file
=
os
.
path
.
join
(
LOGPATH
,
jid
)
if
not
os
.
path
.
exists
(
path_to_file
):
return
0
fic
=
open
(
path_to_file
,
'
r
'
)
...
...
@@ -115,6 +137,8 @@ class Logger:
'''
return number of lines read and the text in the lines
return 0 and empty respectively if log file does not exist
'''
path_to_file
=
os
.
path
.
join
(
LOGPATH
,
jid
.
split
(
'
/
'
)[
0
])
if
os
.
path
.
isdir
(
path_to_file
):
path_to_file
=
os
.
path
.
join
(
LOGPATH
,
jid
)
if
not
os
.
path
.
exists
(
path_to_file
):
return
0
,
[]
fic
=
open
(
path_to_file
,
'
r
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment