Skip to content

Commit

Permalink
chore: remove logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Ellison committed May 17, 2023
1 parent f6d5b2d commit 574f618
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion components/ErrorBoundary.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ErrorBoundary extends React.Component {
}
componentDidCatch(error, errorInfo) {
// You can use your own error logging service here
console.log({ error, errorInfo });
// console.log({ error, errorInfo });
}
render() {
// Check if the error is thrown
Expand Down
2 changes: 1 addition & 1 deletion components/Step.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const Step = ({ children, order, duration = 0.5 }) => {
addStep(order);
}
// return () => {
// console.log("removing step");
// // console.log("removing step");
// removeStep(id.current);
// };
}, [order, addStep, removeStep]);
Expand Down
2 changes: 1 addition & 1 deletion layouts/SlidePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ function SlidePage({ children, next }) {
setSlide(slideCount);
}

console.log('generatedSlides[currentSlide]: ', generatedSlides[currentSlide])
// console.log('generatedSlides[currentSlide]: ', generatedSlides[currentSlide])
return <Slide>{generatedSlides[currentSlide]}</Slide>;
};

Expand Down
2 changes: 1 addition & 1 deletion pages/api/etherpad/pad.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default async function handler(req, res) {
pad = resp.data.data?.text.text
res.status(200).json({ content: pad })
} catch (error) {
console.log(error)
// console.log(error)
res.status(500).json({error: 'error fetching pad: ' + error})
}
}
6 changes: 3 additions & 3 deletions pages/api/files/all-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ export default async function handler(req, res) {

glob(targetDir + '/**/*.md*', (err, files) => {
if (err) {
console.log('Error', err)
// console.log('Error', err)
} else {
console.log(files)
// console.log(files)
res.status(200).json({ files: files, })
}
})

} catch (error) {
console.log(error)
// console.log(error)
}
};
4 changes: 2 additions & 2 deletions pages/editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default function Home() {
// console.log('data : ', data )
})
.catch(error => {
console.log(error)
// console.log(error)
})
.finally(() => {
setTimeout(() => setRefreshToken(Math.random()), 5000);
Expand Down Expand Up @@ -241,7 +241,7 @@ export default function Home() {
// // console.log('data : ', data )
// })
// .catch(error => {
// console.log(error)
// // console.log(error)
// })
// .finally(() => {
// setTimeout(() => setRefreshToken(Math.random()), 5000);
Expand Down
2 changes: 1 addition & 1 deletion pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export default function Home() {
setPadList(data.pads)
})
.catch(error => {
console.log(error)
// console.log(error)
})
.finally(() => {
setTimeout(() => setRefreshToken(Math.random()), 5000);
Expand Down
42 changes: 21 additions & 21 deletions pages/output/[...parms].jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ function useMdx(defaults) {
})
).default
} catch (error) {
console.log('output:evalutate:Error: ', error)
console.log('output:evalutate:Error/Content: ', file)
// console.log('output:evalutate:Error: ', error)
// console.log('output:evalutate:Error/Content: ', file)
const message =
error instanceof VFileMessage ? error : new VFileMessage(error)

Expand All @@ -73,7 +73,7 @@ function useMdx(defaults) {

message.fatal = true
}
console.log('output:evalutate:Success/Content: ', file)
// console.log('output:evalutate:Success/Content: ', file)
setState({ ...config, file })
},
{ leading: true, trailing: true, wait: 0 }
Expand Down Expand Up @@ -140,7 +140,7 @@ function Page() {
})

const mdxContent = (format, mdx, pageParms) => {
console.log('pageParms: ', pageParms)
// console.log('pageParms: ', pageParms)
if (pageParms && pageParms.parms) { delete pageParms.parms };
const { content, data } = matter(mdx);
let frontmatter = { ...data, ...pageParms };
Expand All @@ -167,26 +167,26 @@ function Page() {
.then((res) => res.json())
.then(data => {
if (data.content) {
console.log('/output/[...params].jsx:useEffect:router.query: ', router.query)
// console.log('/output/[...params].jsx:useEffect:router.query: ', router.query)

console.log('/output/[...params].jsx:useEffect:content: ', mdxContent(format, data.content, router.query))
// console.log('/output/[...params].jsx:useEffect:content: ', mdxContent(format, data.content, router.query))

setConfig({ ...state, value: String(mdxContent(format, data.content, router.query)) })
} else if (error) {
console.log('output:error: ', error)
// console.log('output:error: ', error)
} else {
console.log('output:error: unknown error')
// console.log('output:error: unknown error')
}
})
.catch(error => {
console.log(error)
// console.log(error)
return { fileData: null, error: error }
})
.finally(() => {
console.log('no timeout')
// console.log('no timeout')
});
} else {
console.log('output:error: no source defined')
// console.log('output:error: no source defined')
}

}
Expand All @@ -197,7 +197,7 @@ function Page() {
.then(data => {
// console.log('data.rev : ', data.rev , 'rev : ', rev)
if (data.rev && data.rev > rev) {
console.log('new revision :', data.rev)
// console.log('new revision :', data.rev)
const newrev = data.rev
fetch(`/api/etherpad/pad?pad=${location}&rev=${newrev}`)
.then((res) => res.json())
Expand All @@ -208,13 +208,13 @@ function Page() {
}
})
.catch(error => {
console.log(error)
// console.log(error)
})
}

})
.catch(error => {
console.log(error)
// console.log(error)
})
.finally(() => {
setTimeout(() => setRefreshToken(Math.random()), 5000);
Expand All @@ -233,21 +233,21 @@ function Page() {
try {
return state.file.result()
} catch (error) {
console.log('/output:Preview:useCallback:Error: ', error)
// console.log('/output:Preview:useCallback:Error: ', error)
return <FallbackComponent error={error} />
}
}, [state])

if (format === 'doc') {
if (state.file && state.file.result) { console.log('/output:PrintView:file: ', state.file.result) }
if (state.file && state.file.result) { // console.log('/output:PrintView:file: ', state.file.result) }
return (
<ErrorBoundary FallbackComponent={ErrorFallback}>
{state.file && state.file.result ? (<PrintView><Preview components={mdComponents} /></PrintView>) : null}
</ErrorBoundary>
)
} else {

if (state.file && state.file.result) { console.log('/output:DefaultView:file: ', state.file.result) }
if (state.file && state.file.result) { // console.log('/output:DefaultView:file: ', state.file.result) }
return (
<ErrorBoundary FallbackComponent={ErrorFallback}>
{state.file && state.file.result ? (<DefaultView><Preview components={mdComponents} /></DefaultView>) : null}
Expand All @@ -260,7 +260,7 @@ function Page() {

// PDF Print View component
function PrintView({ children }) {
console.log('/output:PrintView:children: ', children);
// console.log('/output:PrintView:children: ', children);

const mdxContainer = useRef(null);
const previewContainer = useRef(null);
Expand All @@ -276,8 +276,8 @@ function PrintView({ children }) {
previewContainer.current
)
.then((flow) => {
console.log('====flow====')
console.log(flow)
// console.log('====flow====')
// console.log(flow)
});
return () => {
document.head
Expand Down Expand Up @@ -306,7 +306,7 @@ function PrintView({ children }) {
// Normal View component
function DefaultView({ children }) {

console.log('DefaultView:children: ', children)
// console.log('DefaultView:children: ', children)
return (
<ThemeProvider theme={theme}>
<CssBaseline />
Expand Down

0 comments on commit 574f618

Please sign in to comment.